Chrono

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

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

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
73 /100 Good
Development Activity 56
Maintenance 64
Community 72
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
84 /100 Excellent
Architecture 88
Code Quality 85
Innovation 82
Learning Curve 85

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 59 apps in this directory

Rust
99%
MIT

abtop

Developer Tools · Monitoring

3,669

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
74
Repo Health
79
Technical
78
Dependency
Built with
Rust 99%
Updated 2 weeks ago
Rust
65%
Apache 2.0

agentgateway

AI Development · Developer Tools · Mcp

5,071

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
69
Dependency
Built with
Rust 65%
Go 23%
Updated 5 days ago
Dart
74%
AGPL 3.0

AppFlowy

AI Assistants · Collaboration · Productivity

76,967

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
67
Dependency
Built with
Dart 74%
Rust 24%
Updated 1 weeks ago
Rust
54%
Other

Cap

Team Chat · Video Conferencing

22,884

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
64
Dependency
Built with
Rust 54%
TypeScript 42%
Updated 4 days ago
Rust
52%
Apache 2.0

cocoindex

AI Development · Data Engineering

11,607

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

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 52%
Python 48%
Updated 4 days ago
Go
59%
Apache 2.0

Cog

AI Development · Developer Tools · Devops

9,484

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

View details
85
Repo Health
88
Technical
69
Dependency
Built with
Go 59%
Rust 17%
HTML 13%
Updated 1 weeks ago
Go
32%
Apache 2.0

CubeSandbox

AI Agents · Developer Tools · Security

12,728

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
82
Repo Health
88
Technical
63
Dependency
Built with
Go 32%
Rust 26%
C 22%
Updated 1 weeks ago
Rust
95%
Other

Databend

Data Engineering · Databases

9,452

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
93
Repo Health
84
Technical
77
Dependency
Built with
Rust 95%
Updated 4 days ago
TypeScript
75%
Apache 2.0

Fern

Developer Tools

3,787

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
66
Dependency
Built with
TypeScript 75%
Updated 4 days ago

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