GetTimeZone

DESCRIPTION

Get the time zone of a region.

RETURNS

Time zone

SYNTAX

getTimeZone()

HISTORY

New in ColdFusion (2021 release)

EXAMPLE

Application.cfc

1
2
3
4
5
component
{
  this.name="TimeZone_func";
  this.timeZone="Japan";
}

getTimezone.cfm

1
2
3
4
5
6
7
8
9
10
<cfscript>
    javatz = CreateObject("java", "java.util.TimeZone");
    tz_list = javatz.getAvailableIDs(); // get a list of all timezone supplied by java util.
    //writedump(tz_list);
    for( i=1; i LTE arrayLen(tz_list); i++)
    {
       setTimeZone(tz_list[i]);
       writeoutput(getTimeZone().timezone);
    }
</cfscript>