GetTimeZone method

Official Content
This documentation is valid for:

The purpose is obtain the CTZ.

Syntax

&TimeZone = DateTime.GetTimeZone()

This is a static function of DateTime data type. Note that ‘DateTime’ is neither a variable nor an attribute; it’s the name of the DateTime data type to which the method is applied.

Type Returned

Timezones Domain

Note: The TimeZones domain doesn’t list all the possible Time Zone values. It may happen that the value returned by this method is _not_ included in the domain.

Example

Event 'GetTZ'
   &Timezones = DateTime.GetTimeZone()
   msg(&Timezones.EnumerationDescription())
Endevent

When this is run in a browser in Uruguay, the following message will be displayed:

America/Montevideo

Scope

Data types DateTime
Languages .NET, Java, Ruby
   

See also

Enabling TimeZone Support
Date Time storage timezone property
SetTimeZone method
FromTimeZone method
CurrentOffset method