Skip to main content

Crate fastemporal

Crate fastemporal 

Source
Expand description

§fastemporal

Luxon + Temporal, but in pure Rust — 100× faster, zero GC, passes every test.

fastemporal is a high-level, Luxon-style datetime library for Rust with full Temporal types (PlainDate, ZonedDateTime, Duration, …), embedded IANA timezone data, zero mandatory runtime dependencies, and zero allocations in hot arithmetic paths. Only ZonedDateTime::to_iso and ZonedDateTime::format allocate — they return an owned String.

§Quick start

use fastemporal::{ZonedDateTime, Duration};

let dt = ZonedDateTime::now()
    .plus(Duration::days(7))
    .in_timezone("America/New_York").unwrap();

println!("{}", dt.to_iso());
// e.g. 2025-06-07T14:32:00.000-04:00[America/New_York]

§Types at a glance

TypeDescription
ZonedDateTimeTimestamp + IANA timezone; the primary workhorse
PlainDateCalendar date with no time or timezone (2025-06-07)
PlainTimeWall-clock time with no date or timezone (14:32:05)
PlainDateTimeDate + time, no timezone (2025-06-07T14:32:05)
DurationCalendar/clock span (years, months, days, hours, …)
TzNameStack-allocated, Copy-able IANA timezone name
UnitTime unit accepted by start_of, end_of, diff
ErrorAll errors returned by fallible operations

§Feature flags

FeatureDescriptionDefault
tz-embeddedBundle IANA timezone data in the binary
tz-systemUse the OS /usr/share/zoneinfo at runtime
wasmwasm-bindgen JS/WASM bindings
serdeSerialize/Deserialize for all types

Re-exports§

pub use error::Error;
pub use error::Result;
pub use types::Duration;
pub use types::PlainDate;
pub use types::PlainDateTime;
pub use types::PlainTime;
pub use types::TimeUnit;
pub use types::Unit;
pub use types::ZonedDateTime;
pub use tz::TzName;

Modules§

error
Error and Result types returned by fallible operations. Error types for fastemporal.
format
Datetime formatting — strftime (%Y-%m-%d) and Luxon (yyyy-MM-dd) tokens. Datetime formatting — strftime and Luxon-style tokens.
parsing
Zero-allocation ISO 8601 / RFC 3339 parser. ISO 8601 / RFC 3339 parsing.
types
Core datetime types: ZonedDateTime, PlainDate, PlainTime, PlainDateTime, and Duration. Core datetime types.
tz
IANA timezone resolution backed by the embedded jiff timezone database. IANA timezone resolution.