fasttime
fasttime is a small UTC-focused date/time library for Rust. It is built
around Ben Joffe's constant-time 64-bit days→date algorithm and offers a simple,
no_std-friendly API for calendar math, parsing, and formatting. The crate
only depends on core by default and enables a handful of conveniences (such as
DateTime::now_utc()) when the optional std feature is on.
Features
- Works in
no_stdenvironments; opt intostdwhen you need wall-clock time. Date,Time,DateTime,Duration,UtcOffset, andOffsetDateTimetypes with ISO/RFC 3339 styleDisplayimplementations.- Parsing helpers for the common textual formats used in logs and APIs.
- Fixed-offset RFC 3339 timestamps with nanosecond precision.
- Simple arithmetic helpers: add days, add durations, compute differences, and fetch ordinals or weekdays without extra allocations.
Installation
[]
= "0.1"
Disable the default std feature when targeting bare-metal or embedded
environments:
[]
= { = "0.1", = false }
Example
use ;
Development
- Format and lint the crate with your preferred Rust tooling (
cargo fmt,cargo clippy). - Run the tests with
cargo test.
License
Licensed under the Apache License, Version 2.0 (see Cargo.toml metadata).