Spec-Zone.ru › ColdFusion

getTimezoneInfo

Gets local time zone information for the computer on which it is called, relative to Universal Time Coordinated (UTC). UTC is the mean solar time of the meridian of Greenwich, England.

getTimezoneInfo(text) → returns any

  • CF4+
  • Lucee
  • BL 1.0.0+
  • See Also: getTimezone setTimezone

    Argument Reference

    timezone string
    Required

    Lucee Specify a timezone to return info from

    locale string
    Required

    Lucee Locale used to format the output

    Examples
    Sample code invoking the getTimezoneInfo function

    Output timezone information

    This example shows the use of GetTimeZoneInfo

    <cfoutput>
    The local date and time are #now()#.
    </cfoutput>
    <cfset info = GetTimeZoneInfo()>
    <cfoutput>
    <p>Total offset in seconds is #info.utcTotalOffset#.</p>
    <p>Offset in hours is #info.utcHourOffset#.</p>
    <p>Offset in minutes minus the offset in hours is #info.utcMinuteOffset#.</p>
    <p>Is Daylight Savings Time in effect? #info.isDSTOn#.</p>
    </cfoutput>

    Get Hawaii timezone information in German

    Shows the use of getTimeZoneInfo for a known / specific timezone with German locale. This syntax is only supported in Lucee.

    <cfscript>
    var tz = getTimeZoneInfo("US/Hawaii", "de-DE");
    </cfscript>

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/gettimezoneinfo

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API