Skip to main content

Crate fasttime

Crate fasttime 

Source
Expand description

fasttime — small UTC date/time library built around Ben Joffe’s fast 64-bit days→date algorithm.

Features:

  • no_std compatible (only core; std is optional).
  • Date / Time / DateTime (UTC).
  • Duration with nanosecond precision.
  • UtcOffset and OffsetDateTime (fixed offset, RFC 3339-style).
  • ISO-like formatting via Display.
  • Parsing of:
    • Date: “YYYY-MM-DD”
    • Time: “HH:MM:SS[.fffffffff]”
    • DateTime (UTC): “YYYY-MM-DDTHH:MM:SS[.fffffffff]Z”
    • OffsetDateTime: “YYYY-MM-DDTHH:MM:SS[.fffffffff][Z|±HH:MM]” (RFC 3339 subset).
  • DateTime::now_utc() when the std feature is enabled.

§Python Bindings

When built with the python feature, this crate provides Python bindings via PyO3. See the python/ directory for examples and documentation.

Structs§

Date
Gregorian calendar date (proleptic).
DateTime
Combined UTC date and time (no time zone).
Duration
Signed duration with nanosecond precision.
OffsetDateTime
Date-time with a fixed offset from UTC (RFC 3339-style).
Time
Time of day in nanoseconds since midnight.
UtcOffset
Fixed offset from UTC, in seconds (e.g. +02:00).

Enums§

DateError
Errors constructing or parsing a Date.
Rfc3339OffsetError
Errors parsing an RFC 3339 UTC offset.
TimeError
Errors constructing or parsing a Time.
UtcOffsetError
Error constructing a UTC offset.
Weekday
Calendar weekday (ISO order, Monday = 1).

Functions§

parse_rfc3339_offset