Time¶
An xsd:time is a time of day, with optional timezone.
-
struct
ExessTime
¶ Time (xsd:time)
-
ExessTimezone
zone
¶ Time zone.
-
uint8_t
hour
¶ Hour: [0, 23].
-
uint8_t
minute
¶ Minute: [0, 59].
-
uint8_t
second
¶ Second: [0, 59].
-
uint32_t
nanosecond
¶ Nanosecond: [0, 999999999].
-
ExessTimezone
-
int
exess_time_compare
(ExessTime lhs, ExessTime rhs)¶ Compare two times.
Note that comparison of times is not always determinate. The comparison of two times works the same way as the comparison of two datetimes with an arbitrary date, see
exess_datetime_compare()
for details.- Returns
-1, 0, or 1 if
lhs
is less than, equal to, or greater thanrhs
, respectively.
-
ExessResult
exess_read_time
(ExessTime *out, const char *str)¶ Read an xsd:time string after any leading whitespace.
- Parameters
out – Set to the parsed value, or zero on error.
str – String input.
- Returns
The
count
of characters read, and astatus
code.
-
ExessResult
exess_write_time
(ExessTime value, size_t buf_size, char *buf)¶ Write a canonical xsd:time string.
The output is always in canonical form, like “12:15” or “02:00Z”.
- Parameters
value – Value to write.
buf_size – The size of
buf
in bytes.buf – Output buffer, or null to only measure.
- Returns
ExessStatus.EXESS_SUCCESS
on success,ExessStatus.EXESS_NO_SPACE
if the buffer is too small, orExessStatus.EXESS_BAD_VALUE
if the value is invalid.
-
EXESS_MAX_TIME_LENGTH
¶ The maximum length of an xsd:time string from
exess_write_time()
, 24.