Name
GetTimeZoneInfo
Synopsis
GetTimeZoneInfo( )Returns a structure containing time-zone information for the host
server calling the function. The following structure keys are
returned by calling GetTimeZoneInfo( ):
-
UTCTotalOffset Returns the local offset time in minutes from Universal Coordinated Time (UTC). UTC is coordinated on the prime meridian (running through Greenwich, U.K.). Positive offset values represent time zones west of the prime meridian, while negative offsets represent time zones east of the prime meridian.
-
UTCHourOffset Returns the local offset time from UTC in hours.
-
UTCMinuteOffset Returns the local offset time in minutes after
UTCHourOffsetis applied. The value forUTCHourOffsetcan range from 0 to 60 depending on where a particular time zone falls in relation to the nearest hour offset. All North American time zones return 0 forUTCMinuteOffset.-
IsDSTOn Returns
trueif daylight savings time (DST) is turned on for the host machine andfalseif it isn’t.
Example:
<cfset MyTimeZoneInfo = GetTimeZoneInfo( )> <cfoutput> Local time is offset #MyTimeZoneInfo.utcTotalOffset# minutes from UTC.<br> Local time is offset #MyTimeZoneInfo.utcHourOffset# hours and #MyTimeZoneInfo.utcMinuteOffset# minutes from UTC.<br> Daylight Saving Time is <cfif #MyTimeZoneInfo.isDSTOn#><b>on</b> <cfelse><b>off</b></cfif> for the host. </cfoutput>