Chrono
Timezone-aware date and time handling for Rust, with correct calendar operations and flexible strftime-style formatting.
Repository Health
Technical Analysis
Chrono is the de facto standard date and time library for Rust, providing timezone-aware DateTime types alongside naive, timezone-agnostic equivalents. It implements the proleptic Gregorian calendar with correct handling of leap years and ambiguous or invalid local times, returning Option or a dedicated MappedLocalTime enum rather than panicking on edge cases.
With over 680 million downloads on crates.io, Chrono underpins the Rust ecosystem’s date and time needs across web services, CLIs, and embedded targets. It ships no_std-compatible core types via opt-in alloc/std features, supports strftime-style parsing and formatting, integrates with Serde for serialization, and pairs with the companion chrono-tz crate for full IANA timezone database support.
What You Get
- Timezone-aware
DateTime<Tz>and naive (timezone-agnostic)NaiveDate/NaiveTime/NaiveDateTimetypes strftime/strptime-style formatting and parsing via theformatmoduleTimeDelta(duration) arithmetic with checked, non-panicking operations- Optional Serde support for serializing and deserializing date and time types
- A
no_stdcore with opt-inalloc,std, andclockfeatures for constrained targets - WASM support via the
wasmbindfeature, interfacing with the JSDateAPI
Common Use Cases
- Web service timestamps - Backend services use
DateTime<Utc>to record and compare event timestamps consistently across time zones. - Log and report formatting - CLI tools and reporting pipelines use Chrono’s
strftime-style formatting to render human-readable dates. - User-facing scheduling - Applications that convert between a user’s local time and UTC, such as calendars and reminders, rely on
LocalandFixedOffsetconversions. - Data parsing - ETL and data-processing code parses date and time strings from external APIs and files using Chrono’s flexible parsing.
Under The Hood
Architecture - Chrono splits into a naive, timezone-agnostic layer (src/naive/{date,time,datetime}) and a timezone-aware layer (src/datetime/mod.rs), which wraps a naive datetime together with an offset implementation such as src/offset/{utc.rs,fixed.rs,local}, unified via the TimeZone trait in src/traits.rs so that DateTime<Tz> is generic over any offset type. The format module (src/format/{parse.rs,formatting.rs,strftime.rs,scan.rs}) implements a token-based, strftime-inspired parser and formatter decoupled from the core date types via an intermediate Parsed struct (src/format/parsed.rs), while low-level calendar arithmetic for the proleptic Gregorian calendar is isolated in src/naive/internals.rs, keeping day-counting math out of the public API surface.
Tech Stack - Chrono is a pure-Rust crate (100% Rust per repository language stats), targeting edition 2021 with an MSRV of 1.62. Its only non-optional dependency is num-traits for generic numeric trait bounds; everything else (serde, rkyv, arbitrary, defmt, pure-rust-locales, wasm-bindgen/js-sys, windows-link, iana-time-zone) is gated behind opt-in Cargo features, reflecting a no_std-first design where even std, alloc, and clock are themselves feature flags. Platform-specific dependencies are split via target.'cfg(...)' sections in Cargo.toml for wasm, Windows, and Unix targets.
Code Quality - The crate carries 333 #[test]-annotated tests embedded alongside implementation code (e.g. src/datetime/tests.rs), plus integration tests under tests/ and dedicated fuzz/ and bench/ directories for fuzzing and performance regression tracking. CI, defined in .github/workflows/test.yml and lint.yml, runs against the pinned MSRV toolchain. The codebase favors returning Option/MappedLocalTime over panicking for fallible operations, per the README’s explicit design goal; internal unwrap() calls that do appear are concentrated in code paths already guarded by prior range checks, a common and accepted pattern in systems-level Rust rather than unchecked risk. Naming is consistently idiomatic Rust (snake_case functions, PascalCase types) throughout.
API Design - Chrono’s public API centers on a small set of composable types (DateTime<Tz>, NaiveDate, NaiveTime, NaiveDateTime, TimeDelta) with consistent constructor and accessor naming (e.g. from_ymd_opt, with_hour) that return Option rather than panicking on invalid input. Roughly 9,500 lines of /// doc comments across the crate give near-complete rustdoc coverage with runnable examples. Getting started requires almost no boilerplate — Utc::now() or NaiveDate::from_ymd_opt(...) — though the naive-vs-timezone-aware type split and the number of Cargo feature flags needed for full functionality (clock, alloc, serde, unstable-locales) add a real, if well-documented, learning curve for newcomers used to simpler date libraries.
Used by 59 apps in this directory
Void
AI Code Assistants · Automation · Code Editors
Open-source AI code editor with direct LLM integration and data privacy
Volga
Data Engineering
A Rust-based real-time data processing engine for AI/ML feature computation, built on Apache DataFusion and Arrow — positioned as an alternative to Flink, Spark, Chronon, and OpenMLDB with unified streaming, batch, and request-time execution.
Windmill
Automation · Developer Tools
Turn scripts into webhooks, workflows, and auto-generated UIs — the fastest self-hostable workflow engine, 13x faster than Airflow.
WrenAI
AI Agents · Analytics · Data Engineering
Open-source GenBI engine that lets AI agents turn natural-language questions into governed SQL, charts, and shareable dashboards across 20+ data sources — no vendor lock-in, no black-box prompts.
YuE2 Studio
Mcp · Music Audio
Windows desktop studio that runs the YuE2 song model on your own NVIDIA GPU: it writes an editable sheet-music score first, then sings it as a full song with vocals, offline, with covers, LoRA training and an MCP server for agents.