ClockGetDayOfWeek
- Last UpdatedOct 29, 2026
- 2 minute read
This function calculates the day of the week that corresponds to a specified number of seconds that have elapsed since 12:00 AM GMT on January 1, 1970.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
ClockGetDayOfWeek |
Date and Time |
Synchronous |
Yes |
Supported |
Supported |
Supported |
Supported |
Supported |
Syntax
ClockGetDayOfWeek( numSeconds, optTimeZone )
numSeconds
A number of seconds that have elapsed since 12:00 AM GMT on January 1, 1970. This number is typically provided by the function GetClock, but it can be any number.
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.
Returned value
If this function is executed successfully, it returns the day of the week as an integer:
|
Value |
Description |
|---|---|
|
0 |
Sunday |
|
1 |
Monday |
|
2 |
Tuesday |
|
3 |
Wednesday |
|
4 |
Thursday |
|
5 |
Friday |
|
6 |
Saturday |
If a time zone is specified, the day is adjusted to reflect the change from the current time zone to 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.
Examples
Get the day of the week when the system clock started counting (that is, Wednesday):
ClockGetTime(0)
Get a returned value of 1 (Monday):
ClockGetDayOfWeek(1018886359)
Get the current number of seconds elapsed since 12:00 AM GMT on January 1, 1970, and then calculate the day of the week:
ClockGetDayOfWeek(GetClock())