Date¶
An xsd:date is a year, month, and day, with optional timezone.
-
int
exess_date_compare(ExessDate lhs, ExessDate rhs)¶ Compare two dates.
Note that comparison of dates is not always determinate. The comparison of two dates works the same way as the comparison of two datetimes with equivalent times, except adjusted according to the timezone if necessary. See
exess_datetime_compare()for details.- Returns
-1, 0, or 1 if
lhsis less than, equal to, or greater thanrhs, respectively.
-
ExessResult
exess_read_date(ExessDate *out, const char *str)¶ Read an xsd:date string after any leading whitespace.
- Parameters
out – Set to the parsed value, or zero on error.
str – String input.
- Returns
The
countof characters read, and astatuscode.
-
ExessResult
exess_write_date(ExessDate value, size_t buf_size, char *buf)¶ Write a canonical xsd:date string.
The output is always in canonical form, like
2001-04-12or-2001-10-26+02:00.- Parameters
value – Value to write.
buf_size – The size of
bufin bytes.buf – Output buffer, or null to only measure.
- Returns
ExessStatus.EXESS_SUCCESSon success,ExessStatus.EXESS_NO_SPACEif the buffer is too small, orExessStatus.EXESS_BAD_VALUEif the value is invalid.
-
EXESS_MAX_DATE_LENGTH¶ The maximum length of an xsd:date string from
exess_write_date(), 18.