humantime

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

Library
Cargo
v2.4.0
396 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
57 /100 Fair
Development Activity 40
Maintenance 44
Community 64
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 75
Code Quality 82
Innovation 65
Learning Curve 90

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
82%
Apache 2.0

headroom

AI Development · Developer Tools

73,966

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
85
Repo Health
86
Technical
69
Dependency
Built with
Python 82%
Rust 12%
Updated 5 days ago
Rust
37%
Other

Hook0

Devops

1,491

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
82
Repo Health
82
Technical
69
Dependency
Built with
Rust 37%
TypeScript 12%
Updated 1 weeks ago
Rust
73%
Other

iii

Developer Tools · Devops

18,814

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

View details
87
Repo Health
85
Technical
65
Dependency
Built with
Rust 73%
TypeScript 16%
Updated 5 days ago
Rust
96%
Apache 2.0

InfluxDB

Analytics · Databases

31,758

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
82
Repo Health
76
Technical
72
Dependency
Built with
Rust 96%
Updated 1 weeks ago
Rust
100%
Other

Meilisearch

Search

59,424

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

View details
89
Repo Health
88
Technical
68
Dependency
Built with
Rust 100%
Updated 1 weeks ago
Rust
86%
AGPL 3.0

ParadeDB

Analytics · Databases · Search

9,311

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
89
Repo Health
87
Technical
68
Dependency
Built with
Rust 86%
PLpgSQL 14%
Updated 4 days ago
Java
93%
Apache 2.0

QuestDB

Analytics · Databases

17,360

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
67
Dependency
Built with
Java 93%
Updated 4 days ago
Rust
77%
AGPL 3.0

Spacedrive

Collaboration · File Storage

39,041

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

View details
56
Repo Health
84
Technical
63
Dependency
Built with
Rust 77%
TypeScript 20%
Updated 2 months 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