ClockUtc
Description
Current wall-clock instant broken down in UTC. Equivalent to DateTimeFromUnixNs(ClockRealNs(), 0).
Success
Returns the current UTC DateTime (utc_offset_seconds == 0).
Failure
Aborts via LOG_FATAL only if the underlying clock query fails (see ClockRealNs).
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Clock.c:104:
}
DateTime ClockUtc(void) {
return DateTimeFromUnixNs(ClockRealNs(), 0);
}- In
Clock.c:49:
static bool test_clock_utc_is_utc(void) {
DateTime d = ClockUtc();
return d.utc_offset_seconds == 0 && d.year >= 2024 && d.month >= 1 && d.month <= 12;
}
Last updated on