Skip to main content

Module dates

Module dates 

Source
Expand description

Turning the dates a vault writes into the dates a feed reader will accept.

A vault’s frontmatter carries dates as whatever the author typed — 2026-08-16, 2026-08-16T09:30:00Z, a YAML timestamp with a space in it. That is right for a document: the grain a person wrote in is information, and prov keeps it. It is wrong for syndication, where the formats are specified and checked: Atom requires RFC 3339 and RSS 2.0 requires RFC 822 dates, and feeds carrying a bare 2026-08-16 are rejected by validators and misparsed by readers.

So this module reads the loose spelling once and writes the strict one, for each of the two grammars that need it. A date with no time of day is read as midnight UTC — the only reading available, and the one every static site generator makes.

Hand-rolled rather than chrono, because this crate must stay portable to wasm32-unknown-unknown and free of a clock: nothing here asks what time it is, it only re-spells a time it was given.

Structs§

Timestamp
A moment, as precisely as the vault happened to write one.

Constants§

EPOCH_RFC3339
The instant a required-but-missing feed date falls back to.

Functions§

parse
Read one of the date spellings a vault may hold.
to_rfc822
Re-spell a vault date as RFC 822, or None if it cannot be read.
to_rfc3339
Re-spell a vault date as RFC 3339, or None if it cannot be read.