Expand description
Time for LeanCTX: UTC instants, signed durations and their text formats.
A thin layer over jiff. LeanCTX stores timestamps in state files,
signs them into receipts and sends them over its wire contracts, so this
crate keeps every format LeanCTX has always written byte for byte:
- serde and
Debug: RFC 3339 in UTC withZand 0, 3, 6 or 9 fractional digits (2026-11-17T10:00:00Z,…00.250Z); UtcDateTime::to_rfc3339: the same with+00:00;UtcDateTime::to_rfc3339_opts: a fixed precision, truncated;Display:2026-11-17 10:00:00 UTC;UtcDateTime::format: strftime (seeformatfor the specifiers);Duration’sDisplay: ISO 8601 (PT90S,-PT0.5S,P0D).
Parsing accepts what LeanCTX has always accepted: strict RFC 3339 in
UtcDateTime::parse_from_rfc3339, and the relaxed form (spaces before
the offset, UTC, offsets without a colon) in FromStr and serde.
Re-exports§
pub use jiff;
Modules§
- format
- strftime and the fixed text formats.
Structs§
- Civil
Date Time - A date and wall-clock time without a time zone (chrono’s
NaiveDateTime). A representation of a civil datetime in the Gregorian calendar. - Date
- A calendar date without a time zone (chrono’s
NaiveDate). A representation of a civil date in the Gregorian calendar. - Duration
- A signed span of time with nanosecond precision.
- Local
Date Time - An instant in the system time zone, for text shown to people.
- Offset
Date Time - An instant together with a fixed UTC offset, as parsed from RFC 3339.
- OutOf
Range Error - The value is outside the range the target type can hold.
- Parse
Error - Why a date and time string did not parse.
- Time
- A wall-clock time without a date or time zone (chrono’s
NaiveTime). A representation of civil “wall clock” time. - UtcDate
Time - An instant in UTC with nanosecond precision.
Enums§
- Seconds
Format - How many fractional digits
UtcDateTime::to_rfc3339_optswrites.
Functions§
- days_
between - Whole days from
earliertolater(negative whenlateris earlier), like chrono’s(later - earlier).num_days(). - parse_
civil_ datetime - Parses a date and wall-clock time with a strftime pattern, like
parse_date. A leap second (:60) reads as:59. - parse_
date - Parses a calendar date with a strftime pattern.
- utc_
from_ civil dtread in UTC;Noneonly in the first and last day of jiff’s range.- utc_
from_ local_ civil dtread as wall-clock time in the system time zone. A repeated hour (DST fold) takes the earlier instant; a skipped hour (DST gap) readsdtas UTC, at most one DST shift off.Noneonly at jiff’s range edges.