Gets time zone information for the server, relative to UTC: utcTotalOffset, utcHourOffset, utcMinuteOffset, isDSTOn and timezone. CF 2025+ also returns DSTOffset, name, nameDST, shortName and shortNameDST, and can describe any timezone.
getTimezoneInfo(text)
→ returns any
US/Eastern. Defaults to the server timezone.
en_US. Defaults to the server locale.
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>
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>
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.