Clk_SetTZ()
Set Clock time zone offset.
Files
clk.h/clk.c
Prototype
Code Block | ||
---|---|---|
| ||
CPU_BOOLEAN Clk_SetTZ (CLK_TZ_SEC tz_sec); |
Arguments
tz_sec
Time zone offset (in seconds, ± from UTC).
Returned Values
DEF_OK
, if time zone is valid and set.
DEF_FAIL
, otherwise.
Required Configuration
None.
Notes / Warnings
Time zone is based on Coordinated Universal Time (UTC) and has valid values:
- Between ±12 hours (±43200 seconds)
- Multiples of 15 minutes
Example Usage
Anchor | ||||
---|---|---|---|---|
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
CLK_TZ_SEC tz_sec;
CPU_BOOLEAN valid;
tz_sec = -5 * 3600;
valid = Clk_SetTZ(tz_sec);
if (valid == DEF_OK) {
printf("Clock Set TZ successful\n\r");
} else {
printf("Clock Set TZ error\n\r");
} |