humantime

A fast parser and formatter for std::time::Duration and SystemTime in human-friendly notation

Library
Cargo
v2.4.0
393stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
60/100Good
Development Activity52
Maintenance44
Community64
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture75
Code Quality82
Innovation65
Learning Curve90

humantime parses and formats Rust’s standard-library Duration and SystemTime types using human-friendly notation, such as 15days 2min 2s for durations and RFC 3339 timestamps like 2018-01-01T12:53:00Z. It’s designed to be extremely fast since the timestamp format it produces and consumes is effectively fixed, avoiding the overhead of general-purpose calendar libraries for the common case of reading/writing timestamps and durations in config files, logs, and CLIs.

Maintained under the chronotope organization (which also maintains the chrono date/time crate), humantime is a small, stable, widely depended-upon utility crate with nearly 400 million total downloads, commonly pulled in as a dependency of logging and CLI-configuration crates like env_logger.

What You Get

  • parse_duration() / format_duration() - free-form duration notation like 15days 2min 2s in both directions
  • parse_rfc3339() / format_rfc3339() - RFC 3339 timestamp parsing and formatting for SystemTime, benchmarked far faster than general calendar libraries for this fixed format
  • A weaker timestamp parser accepting space-separated dates like 2018-01-01 12:53:00
  • Duration/Timestamp wrapper types implementing FromStr/Display for direct use with clap argument parsing or serde
  • Companion crate humantime-serde for direct serde integration (the README notes the older serde-humantime crate is unmaintained)

Common Use Cases

  • Parsing CLI flags like --timeout 30s or --retention 7days into std::time::Duration via clap integration
  • Reading/writing human-readable durations and timestamps in config files (YAML/TOML) without pulling in a full calendar library
  • Formatting log timestamps in RFC 3339 with minimal overhead — used internally by env_logger for its timestamp output
  • Any place a Rust program needs quick, allocation-light SystemTime/Duration <-> string conversion

Under The Hood

Architecture - The crate is small and focused: duration.rs implements the free-form duration grammar (parsing tokens like 15days, 2min) and its formatter, date.rs implements the RFC 3339 timestamp parser/formatter plus the looser space-separated variant, and wrapper.rs provides the newtype wrappers (Duration, Timestamp) implementing FromStr/Display so the crate’s types slot directly into clap or serde without adapter code. Tech Stack - Zero required runtime dependencies beyond std; dev-dependencies include bencher for micro-benchmarks and the time crate (for comparison benchmarks against chrono/time in benches/), edition 2021, MSRV 1.60, dual MIT/Apache-2.0 licensed. Code Quality - date.rs and duration.rs carry 26 and 14 inline #[test] functions respectively covering parse/format round-trips and edge cases; the README documents concrete benchmark numbers (e.g. RFC 3339 parsing at ~24-36ns/iter versus ~737ns/iter for chrono) demonstrating the performance claims are backed by tracked benchmarks rather than assertions. API Design - The API is deliberately minimal — four core functions plus two wrapper types — favoring a handful of well-named free functions over a builder or configuration object, which keeps the learning curve low at the cost of configurability (e.g. the timestamp format is effectively fixed rather than customizable).

Used by 8 apps in this directory

Python
80%
Apache 2.0

headroom

AI Development · Developer Tools

66,835

Compress everything your AI agent reads — tool outputs, logs, RAG chunks, and files — before it reaches the LLM, achieving 60–95% fewer tokens with the same answers.

View details
84
Repo Health
86
Technical
73
Dependency
Built with
Python80%
Rust14%
Updated today
Rust
41%
Other

Hook0

Devops

1,477

Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.

View details
83
Repo Health
82
Technical
70
Dependency
Built with
Rust41%
TypeScript17%
JavaScript15%
Updated today
Rust
72%
Other

iii

Developer Tools · Devops

18,604

Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.

View details
86
Repo Health
85
Technical
69
Dependency
Built with
Rust72%
TypeScript17%
Updated yesterday
Rust
96%
Apache 2.0

InfluxDB

Databases · Analytics

31,705

Open-source time-series database built for real-time ingest, fast SQL queries, and embedded Python automation — powered by Apache Arrow and Parquet.

View details
86
Repo Health
76
Technical
72
Dependency
Built with
Rust96%
Updated yesterday
Rust
100%
Other

Meilisearch

Search

59,012

Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.

View details
90
Repo Health
88
Technical
68
Dependency
Built with
Rust100%
Updated 5 days ago
Rust
87%
AGPL 3.0

ParadeDB

Search · Databases · Analytics

9,175

Born out of Y Combinator's S2023 batch, ParadeDB is a Postgres extension that delivers Elasticsearch-quality BM25 search and real-time analytics without a separate search cluster to manage.

View details
88
Repo Health
87
Technical
71
Dependency
Built with
Rust87%
PLpgSQL12%
Updated today
Java
92%
Apache 2.0

QuestDB

Databases · Analytics

17,263

A high-performance, open-source time-series database built for financial market data, IoT telemetry, and real-time analytics, combining a zero-GC Java/C++ core with SIMD-accelerated SQL and a WAL-to-Parquet storage engine.

View details
91
Repo Health
86
Technical
70
Dependency
Built with
Java92%
Updated today
Rust
77%
AGPL 3.0

Spacedrive

File Storage · Collaboration

38,790

One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.

View details
60
Repo Health
84
Technical
65
Dependency
Built with
Rust77%
TypeScript20%
Updated 3 weeks 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

Search