Skip to content

QronoSmall. Complete. Deterministic.

A 4kB JavaScript date library with 100+ APIs and strict DST guarantees.
Designed for single-timezone applications.

Quick Start

sh
npm install qrono
sh
bunx jsr add @urin/qrono
sh
deno add jsr:@urin/qrono
html
<script src="https://unpkg.com/qrono/dist/qrono.min.js"></script>
javascript
import { qrono } from 'qrono'

// UTC-first
const now = qrono().toString() // '2027-01-23T12:34:56:789Z'
// DST overlap (occurs twice) of Europe/London
qrono.context({ localtime: true })
const t = '2019-10-27T01:30:00'
qrono(t) // 01:30 +00:00 Same as JavaScript's `Date`
qrono({ disambiguation: 'earlier' }, t) // 01:30 +00:00
qrono({ disambiguation: 'later' }, t)   // 01:30 +01:00
qrono({ disambiguation: 'reject' }, t)  // throws RangeError

now.plus(0, 1, 10) // +1 month, +10 days
now.startOfMonth()
now.isBetween(qrono('2024-01-01'), qrono('2024-12-31'))
const date = qrono.date('2024-06-15')
date.dayOfYear()   // 167
date.weekOfYear()  // 24
date.endOfMonth()  // 2024-06-30

Learn More