libiso8601
0.3.14
|
Functions | |
void | iso8601_now (struct iso8601_date *date, struct iso8601_details *details) |
Retrieve the current time. More... | |
int | iso8601_set_sysclock (const struct iso8601_date *date) |
Set the system clock. More... | |
void | iso8601_from_ts (struct iso8601_date *date, const struct timespec *ts) |
Convert from a struct timespec. | |
void | iso8601_to_ts (struct timespec *ts, const struct iso8601_date *date) |
Convert to a struct timespec. | |
void | iso8601_from_tv (struct iso8601_date *date, const struct timeval *tv) |
Convert from a struct timeval. | |
void | iso8601_to_tv (struct timeval *tv, const struct iso8601_date *date) |
Convert to a struct timeval. | |
void | iso8601_from_time_t (struct iso8601_date *date, const time_t *t) |
Convert from a time_t. | |
void | iso8601_to_time_t (time_t *t, const struct iso8601_date *date) |
Convert to a time_t. | |
These functions enable integration with the C library (system call wrappers and conversion).
void iso8601_now | ( | struct iso8601_date * | date, |
struct iso8601_details * | details | ||
) |
Retrieve the current time.
[out] | date | Current date/time (may be 0), in UTC. May be 0. |
[out] | details | Details (may be 0), including timezone. May be 0. |
Retrieves the current time from the system clock, storing it into date and details (both parameters optional).
int iso8601_set_sysclock | ( | const struct iso8601_date * | date | ) |
Set the system clock.
date | Date to set. |
0 | on success. |
-1 | on error (and see errno). |
Attempts to set the system clock using clock_settime()
, falling back to settimeofday()
. The user will need the CAP_SYS_TIME
capability to set the clock, otherwise errno will be set to EPERM
.