A modern date and time library. 3x faster than moment.js, zero dependencies.
Install · Quick Start · Docs · Releases
Chrono is a lightweight, immutable, and chainable date/time library for JavaScript and TypeScript. It handles parsing, formatting, manipulation, and comparison of dates without the bloat.
| Chrono | moment.js | dayjs | date-fns | |
|---|---|---|---|---|
| Bundle size | 2.1 kB | 72 kB | 2 kB | 7 kB |
| Immutable | Yes | No | Yes | Yes |
| TypeScript | Native | Community | Plugin | Native |
| Timezone support | Built-in | Plugin | Plugin | Plugin |
| Chainable | Yes | Yes | Yes | No |
| Speed (ops/sec) | 1.2M | 380K | 950K | 620K |
npm install @chrono/coreimport { chrono } from "@chrono/core";
// Current time
const now = chrono();
// Parse from string
const date = chrono("2025-01-15T09:30:00");
// Chainable manipulation
const future = chrono()
.add(3, "days")
.subtract(2, "hours")
.startOf("month");
// Format
future.format("MMMM Do YYYY, h:mm a");
// "January 1st 2025, 12:00 am"
// Difference
chrono("2025-12-31").fromNow();
// "in 5 months"
// Timezone conversion
chrono().tz("America/New_York").format("h:mm a");- Immutable -- Every operation returns a new instance. No surprises.
- Chainable -- Fluent API for readable, composable code.
- TypeScript -- Full type definitions out of the box.
- Timezone -- Built-in IANA timezone support. No plugins needed.
- i18n -- 40+ locales included.
- Parsing -- ISO 8601, RFC 2822, and custom format strings.
- Zero dependencies -- Nothing to pull in. No tree-shaking required.
All benchmarks run on Node.js 22, 10,000 iterations.
| Operation | Chrono | dayjs | date-fns | moment.js |
|---|---|---|---|---|
| Parse (ISO) | 1.2M ops/s | 950K | 620K | 380K |
| Format | 1.8M ops/s | 1.1M | 720K | 310K |
| Add (1 day) | 3.1M ops/s | 2.4M | 890K | 340K |
| Diff (days) | 2.6M ops/s | 1.8M | 1.1M | 290K |
- Fork the repository
- Create a feature branch
- Submit a pull request
MIT
Open sourced by Kelender