Skip to main content

Module datetime

Module datetime 

Source
Expand description

Written here rather than delegated to a date crate because the two rules that matter are policy, not parsing: a Date is never widened into an instant, and a DateTime without an offset is an error rather than a guess about local time. Typed conversion happens in the bindings.

Functionsยง

validate_date
Strict YYYY-MM-DD, including month lengths and leap years.
validate_datetime
RFC 3339 with a mandatory offset. Returns Code::MissingTimezone when the value is well-formed but unzoned, since that is the common mistake.