Time

This contains all time functionality. More...

Modules

Types
Time specific types.
 

Functions

zos_result_t zn_time_get_up_time (zos_time_t *time)
 Returns the system's uptime as a zos_time_t. More...
 
zos_result_t zn_time_get_up_time_raw (uint64_t *time)
 Returns the system's uptime in milliseconds. More...
 
zos_result_t zn_time_get_rtc_time (zos_time_t *time)
 Returns the current time as a zos_time_t. More...
 
zos_result_t zn_time_get_rtc_time_raw (uint64_t *time)
 Returns the current time in milliseconds. More...
 
zos_result_t zn_time_set_rtc_time_raw (uint64_t *time)
 Sets the current time in milliseconds. More...
 
char * zn_time_get_utc_time (char *time_str_buffer)
 Returns the current time as an ISO8601 string. More...
 
char * zn_time_to_str (const zos_time_t *time, char *time_str_buffer)
 Convert zos_time_t to an ISO8601 string. More...
 
char * zn_time_utc_to_str (const uint64_t *utc_ms, char *time_str_buffer)
 Convert UTC time in milliseconds to an ISO8601 string. More...
 

Detailed Description

This contains all time functionality.

Function Documentation

zos_result_t zn_time_get_rtc_time ( zos_time_t time)

Returns the current time as a zos_time_t.

Examples:
basic/log_file/log_file.c.
zos_result_t zn_time_get_rtc_time_raw ( uint64_t *  time)

Returns the current time in milliseconds.

This API will return ZOS_NEVER_SET if the UTC time was never set.

Note
The UTC time will persist through reboots and resets as long as the Wi-Fi module is powered.

See zn_ntp_update() for more details about obtaining the current UTC time via Network Time Protocol (NTP)

Examples:
cloud/s2cdemo/main.c.
zos_result_t zn_time_get_up_time ( zos_time_t time)

Returns the system's uptime as a zos_time_t.

zos_result_t zn_time_get_up_time_raw ( uint64_t *  time)

Returns the system's uptime in milliseconds.

Examples:
cloud/s2cdemo/main.c.
char* zn_time_get_utc_time ( char *  time_str_buffer)

Returns the current time as an ISO8601 string.

Note
time_str_buffer must be at least 28 bytes
zos_result_t zn_time_set_rtc_time_raw ( uint64_t *  time)

Sets the current time in milliseconds.

char* zn_time_to_str ( const zos_time_t time,
char *  time_str_buffer 
)

Convert zos_time_t to an ISO8601 string.

Note
time_str_buffer must be at least 28 bytes
Examples:
basic/log_file/log_file.c, and cloud/cloud_filesystem/cloud_filesystem.c.
char* zn_time_utc_to_str ( const uint64_t *  utc_ms,
char *  time_str_buffer 
)

Convert UTC time in milliseconds to an ISO8601 string.

Note
time_str_buffer must be at least 28 bytes