Familiar Token Syntax
Use the same YYYY-MM-DD, HH:mm:ss, and MMMM Do patterns you already know from Moment.js and date-fns — no new format language to learn.
Moment.js token syntax for the native Temporal API. Zero dependencies. < 2KB gzipped.
import { format, fromNow, calendar, humanizeDuration, fromDate } from 'moment-less'
// Token-based formatting
const dt = Temporal.PlainDateTime.from('2026-04-09T14:05:00')
format(dt, 'MMMM Do, YYYY [at] h:mm A')
// → "April 9th, 2026 at 2:05 PM"
// Relative time
const past = Temporal.PlainDateTime.from('2026-04-09T11:00:00')
fromNow(past, dt)
// → "3 hours ago"
// Calendar label
calendar(past, dt)
// → "Today at 11:00 AM"
// Duration humanization
const dur = new Temporal.Duration(0, 0, 0, 0, 2, 45)
humanizeDuration(dur)
// → "3 hours"
// Bridge from legacy Date
const inst = fromDate(new Date())
format(inst, 'YYYY-MM-DDTHH:mm:ssZ')
// → "2026-04-09T14:05:00+00:00"