Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Time Representation APIs

Macros

#define TIME_UTILS_BASE_YEAR   1900
 

Functions

int64_t timeutil_timegm64 (const struct tm *tm)
 Convert broken-down time to a POSIX epoch offset in seconds.
 
time_t timeutil_timegm (const struct tm *tm)
 Convert broken-down time to a POSIX epoch offset in seconds.
 

Detailed Description

Macro Definition Documentation

◆ TIME_UTILS_BASE_YEAR

#define TIME_UTILS_BASE_YEAR   1900

Function Documentation

◆ timeutil_timegm()

time_t timeutil_timegm ( const struct tm * tm)

#include <zephyr/sys/timeutil.h>

Convert broken-down time to a POSIX epoch offset in seconds.

Parameters
tmpointer to broken down time.
Returns
the corresponding time in the POSIX epoch time scale. If the time cannot be represented then (time_t)-1 is returned and errno is set to ERANGE`.
See also
http://man7.org/linux/man-pages/man3/timegm.3.html

◆ timeutil_timegm64()

int64_t timeutil_timegm64 ( const struct tm * tm)

#include <zephyr/sys/timeutil.h>

Convert broken-down time to a POSIX epoch offset in seconds.

Parameters
tmpointer to broken down time.
Returns
the corresponding time in the POSIX epoch time scale.
See also
http://man7.org/linux/man-pages/man3/timegm.3.html