Skip to main content

Module datetime

Module datetime 

Source
Expand description

xs:dateTime (accepted subset), HTTP Date and NTP timestamp readers.

The accepted xs:dateTime subset is project policy, recorded with its rationale and the full accept/reject table in private/specs-verified/dash/docs-specs/xs-datetime-subset.md (W3C XML Schema Part 2, 3.2.7; ISO/IEC 23009-1 5.8.5.7 DIRECT-VALUE). Calendar arithmetic is jiff’s; nothing here reads a clock.

Structs§

XsDateTime
A parsed instant plus how finely the source stated it.

Enums§

DateTimeError
Why a time string or timestamp was rejected.

Functions§

parse_http_date
Parse an HTTP-date (RFC 9110 5.6.7) to Unix microseconds: the preferred IMF-fixdate and the two obsolete forms a recipient must still accept, the RFC 850 form (two-digit years follow jiff’s POSIX window: 69-99 are 19xx, 00-68 are 20xx, so no clock is needed) and the asctime form (always UTC). Resolution is whole seconds. Used for the Date and Retry-After headers.
parse_ntp_timestamp
Read a 64-bit NTP timestamp (RFC 5905 Figure 3: 32-bit seconds since 1900-01-01T00:00:00Z, 32-bit binary fraction; era 0) as Unix microseconds.
parse_xs_datetime
Parse an xs:dateTime under the accepted-subset policy.