Chrono

Timezone-aware date and time handling for Rust, with correct calendar operations and flexible strftime-style formatting.

Library
Cargo
v0.4.45
3,893stars
MIT OR Apache-2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
81/100Excellent
Development Activity72
Maintenance80
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
84/100Excellent
Architecture88
Code Quality85
Innovation82
Learning Curve85

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/NaiveDateTime types
  • strftime/strptime-style formatting and parsing via the format module
  • TimeDelta (duration) arithmetic with checked, non-panicking operations
  • Optional Serde support for serializing and deserializing date and time types
  • A no_std core with opt-in alloc, std, and clock features for constrained targets
  • WASM support via the wasmbind feature, interfacing with the JS Date API

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 Local and FixedOffset conversions.
  • 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 52 apps in this directory

Rust
100%
MIT

abtop

Developer Tools · Monitoring

3,456

Like htop, but for your AI coding agents — monitor Claude Code, Codex CLI, and OpenCode sessions, tokens, context windows, rate limits, and orphan ports all from one terminal screen.

View details
77
Repo Health
79
Technical
80
Dependency
Built with
Rust100%
Updated 3 weeks ago
Rust
64%
Apache 2.0

agentgateway

AI Development · Developer Tools

4,420

An open source AI-native proxy that secures, observes, and governs agent-to-LLM, agent-to-tool, and agent-to-agent communication through MCP, A2A, and unified LLM routing.

View details
88
Repo Health
82
Technical
72
Dependency
Built with
Rust64%
Go24%
Updated yesterday
Dart
74%
AGPL 3.0

AppFlowy

Productivity · Project Management · Collaboration

75,729

The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.

View details
66
Repo Health
81
Technical
66
Dependency
Built with
Dart74%
Rust24%
Updated 1 weeks ago
TypeScript
55%
Other

Cap

Team Chat · Video Conferencing

20,986

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
65
Dependency
Built with
TypeScript55%
Rust40%
Updated yesterday
Rust
52%
Apache 2.0

cocoindex

Data Engineering · AI Development

11,350

An incremental data indexing engine that keeps AI agent context perpetually fresh by reprocessing only what changed.

View details
87
Repo Health
85
Technical
64
Dependency
Built with
Rust52%
Python48%
Updated yesterday
Go
59%
Apache 2.0

Cog

AI Development · Devops · Developer Tools

9,459

An open-source CLI that packages machine learning models into standard, production-ready Docker containers — no Dockerfile wrangling, no CUDA version hell.

View details
91
Repo Health
88
Technical
70
Dependency
Built with
Go59%
Rust16%
HTML13%
Updated today
Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,247

Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.

View details
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust31%
C21%
Updated today
Rust
95%
Other

Databend

Databases · Data Engineering

9,414

Open-source enterprise data warehouse unifying analytics, vector search, full-text search, and AI agent orchestration in a single Rust-built engine on S3.

View details
91
Repo Health
84
Technical
79
Dependency
Built with
Rust95%
Updated today
TypeScript
75%
Apache 2.0

Fern

Developer Tools

3,761

Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.

View details
90
Repo Health
86
Technical
67
Dependency
Built with
TypeScript75%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search