GetClock
- Last UpdatedOct 29, 2026
- 2 minute read
GetClock is a built-in function that gets how many seconds have elapsed since 12:00 AM GMT on January 1, 1970, according to the system clock.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
GetClock |
Date and Time |
Synchronous |
Yes |
Supported |
Supported |
Not supported |
Supported |
Executed on Server |
Syntax
GetClock(optTimeZone)
GetClock ( { | 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 server or the project thin client, depending on where the function is called. This might be different from the current time zone in the local computer's system settings, if the function SetTimeZone was previously executed. |
|
1 |
Coordinated Universal Time (UTC). |
|
2 |
The current time zone in the local computer's system settings. |
|
"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
This function returns the number of seconds that have elapsed since 12:00 AM GMT on January 1, 1970, according to the system clock. If a time zone is specified (that is, if optTimeZone is any value other than 0), the number of seconds is adjusted to reflect the difference between the current time zone and the specified time zone.
Notes
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.