Expand description
Time helpers for RFC3339 timestamps with consistent precision.
Responsibilities:
- Parse RFC3339 timestamps for queue/reporting workflows.
- Format timestamps with fixed 9-digit fractional seconds in UTC.
- Provide a testable fallback mechanism for formatting failures.
Does not handle:
- Parsing non-RFC3339 timestamp formats.
- Guessing or inferring time zones for naive timestamps.
Invariants/assumptions:
- Callers provide RFC3339 strings when parsing.
- Formatted timestamps are always UTC with 9-digit subseconds.
- Formatting errors are logged and result in a sentinel fallback value.
Re-exports§
pub use crate::constants::defaults::FALLBACK_RFC3339;
Functions§
- format_
rfc3339 - now_
utc_ rfc3339 - now_
utc_ rfc3339_ or_ fallback - Returns the current UTC timestamp in RFC3339 format, or a sentinel fallback on error.
- parse_
relative_ time - Parse a relative or absolute time expression into RFC3339.
- parse_
rfc3339 - parse_
rfc3339_ opt