Skip to main content

is_valid_rfc3339

Function is_valid_rfc3339 

Source
pub fn is_valid_rfc3339(s: &str) -> bool
Expand description

Return true when s is a complete RFC 3339 date-time, such as 2026-02-14T10:30:00Z or 2026-02-14T10:30:00.5+08:00.

Composed from is_valid_rfc3339_date and is_valid_rfc3339_time: a full-date, a T/t separator, a partial-time (with optional fractional seconds), and a mandatory time-offset — either Z/z or ±HH:MM with HH in 00..23 and MM in 00..59. The offset is required, so a bare 2026-02-14T10:30:00 is rejected; a space separator is rejected (only T/t is accepted); and a leap second (:60) is rejected, matching is_valid_rfc3339_time. Non-ASCII input is rejected.