GetTimeZone
- Last UpdatedOct 29, 2026
- 2 minute read
This function gets a specified time zone name or index.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
GetTimeZone |
Date and Time |
Synchronous |
Yes |
Supported |
Supported |
Not supported |
Supported |
Executed on Server |
Syntax
GetTimeZone( optTimeZone )
GetTimeZone ( { | optTimeZone } )
optTimeZone
A time zone name (string) or index (integer).
|
Value |
Description |
|---|---|
|
-i |
A time zone index (i), up to the maximum index returned by the function GetTimeZoneCount. |
|
0 |
The current time zone in either the project runtime or the Viewer module / thin client, depending on where the function is called from. |
|
"timezone" |
The full name of a time zone (for example, "Central Standard Time"). |
This parameter is optional; if no value is specified, the default value is 0.
Return value
If optTimeZone is a time zone name, this function returns the corresponding index. If optTimeZone is a time zone index, this function returns the corresponding name. Otherwise, this function returns one of the following possible values:
|
Value |
Description |
|---|---|
|
2 |
Invalid number of parameters. |
|
3 |
Invalid time zone name or index. |
Notes
The list of available time zones varies by operating system version and configuration. If necessary, you can use this function in combination with the function GetTimeZoneCount to generate a list that is specific to your computer.
If this function is called in a project screen on Mobile Access, it is executed using the system clock and date/time settings on the computer that hosts the project runtime server.
Examples
Get the current time zone:
GetTimeZone()
Get the time zone name that corresponds to time zone index 24:
GetTimeZone(-24)
Get the time zone index that corresponds to Central Standard Time:
GetTimeZone("Central Standard Time")