Set the current date and time.
Usages
clk_set [VALUE] {[FORMAT]}
Arguments
{[FORMAT]} is an optional argument :
- -d, --datetime for DATETIME format.
- -u, --unix for UNIX format.
- -n, --ntp for NTP format.
if FORMAT is not provided, [VALUE] is assumed to be in DATETIME format.
[VALUE] is :
YYYY-MM-DD {HH:MM:SS {UTC±HH:MM}}
for DATETIME format.- Providing the time is optional but required if the timezone is provided.
- Providing the timezone is optional.
- a 32-bit integer greater than 946684799 for UNIX format.
- a 32-bit integer greater than 3155673599 for NTP format.
Output
Echo the set date and time in DATETIME format.
Required Configuration
Configuration | Value | Notes |
---|---|---|
CLK_CFG_STR_CONV_EN | DEF_ENABLED | Required to echo the set date and time. If set to DEF_DISABLED, the date and time set will still be effective. |
CLK_CFG_UNIX_EN | DEF_ENABLED | Required to set the date and time in UNIX format. |
CLK_CFG_NTP_EN | DEF_ENABLED | Required to set the date and time in NTP format. |
Notes/Warnings
Clk module epoch start on Jan 1st, 2000 at 00:00 UTC.
Only UTC timezone is supported.
Examples