moment-style tokens · presets · live

Format dates with tokens

Pick a moment-style pattern (YYYY-MM-DD, dddd, hh:mm A, …) and watch the output update live. Click presets or write your own.

Quick Start

How token formatting works

Moment-style tokens stand in for date parts: YYYY = year, MM = month, DD = day, HH = 24h, hh = 12h, mm = minute, ss = second. Anything else is passed through.

  1. 01

    Pick a date

    Local datetime-local input — your timezone.

    Parsing accepts ISO 8601, RFC 3339, RFC 2822, and Unix epoch seconds/milliseconds. The Date constructor handles the rest with browser-engine consistency.

    inputISO 8601RFC 3339epochlive
    in · timestampdate · ISO
    2026-05-21T12:00
    loaded · ISO 8601zone · ready
  2. 02

    Choose a preset

    One click pastes a familiar moment pattern into the field.

    All math runs in UTC internally to avoid DST landmines; presentation converts back to the user’s zone via Intl.DateTimeFormat.

    presetUTC mathIntlDST-safelive
    preset · optionsISO · live
    YYYY-MM-DD
    options applied · UTCDST-safe
  3. 03

    Customize tokens

    Swap MM → MMM for short month names, h → hh for 12-hour padding.

    Output respects the chosen timezone offset (Z vs +05:30) and pads digits per ISO conventions so sorts stay chronological.

    tokensoffsetzone-awaresortablepadded
    tokens · computededit · ready
    ddd, DD MMM YYYY
    computed · instantsortable
  4. 04

    Copy result

    One-click copy of the formatted string.

    Copy writes via the Async Clipboard API; nothing pings a time server — the browser’s clock is the only oracle.

    copyclipboardno oracledeterministicclient-side
    ✓ · copiedready · done
    ✓ Copied
    shipped · ready to shipsuccess
Pro tips

Time math without DST landmines

Always store UTC

Convert to local for display only. UTC storage avoids DST jumps and timezone drift in databases.

Watch leap seconds

POSIX time doesn’t count leap seconds; some systems do. Don’t use timestamps for sub-second precision across boundaries.

Prefer Temporal eventually

The Date API has many quirks. Temporal is shipping in modern engines and handles zones correctly.

Cron is timezone-tricky

Cron expressions run in the daemon’s local zone unless told otherwise. Pin a TZ explicitly for predictable runs.

ISO 8601 sorts naturally

YYYY-MM-DDTHH:mm:ss sorts correctly as a string. Don’t use US-style MM/DD/YYYY for anything machine-readable.

Beware Y2K38

Signed 32-bit Unix timestamps overflow in 2038. Use 64-bit storage end-to-end for long-lived systems.

Use Cases

When to format dates

UIs, exports, logs.

UI strings

Sketch a label for a hero before locking it down in code. Math runs in UTC under the hood to dodge DST jumps — local time is only for display. That means scheduling logic and date diffs survive March / November fall-back without the classic off-by-one-hour bug.

DST-safe

CSV exports

Pick the column format your spreadsheet expects. Browser clock is the only source — no external time server, no privacy leak, no rate limit. Pair with NTP-synced server time for high-accuracy use cases, but for human-scale work the browser clock is plenty.

UTC-correct

Email templates

Test how dates read in a customer mailing. ISO 8601 output sorts naturally as strings, perfect for filenames (report-2026-01-15.pdf) and log lines that need chronological ordering without parsing. Drop into S3 keys for free time-bucketing.

ISO-sortable

Moment migration

Verify a token still produces the same string before porting to Luxon. Pairs cleanly with cron, scheduled tasks, and timestamped log analysis. The tool's output drops directly into APScheduler, Linux cron, or GitHub Actions schedule expressions without re-formatting.

spec-grade

Cron descriptions

Render the next-run as a friendly string. Output respects the chosen timezone offset (Z vs +05:30) so REST APIs and database TIMESTAMP WITH TIME ZONE columns round-trip cleanly. No ambiguity between "noon UTC" and "noon local".

zone-aware

Localisation tests

Spot ambiguous orderings (MM/DD vs DD/MM) before shipping. Confirms the difference between epoch seconds (10 digits) and milliseconds (13 digits) before you commit code that mis-multiplies by 1000 — a classic bug in cross-language time handling.

i18n
FAQ

Frequently asked questions

Moment tokens are the most widely recognised — used by Day.js, date-fns formats and many DBs.
No — see strftime Builder. They're different token languages.
Output reflects your browser's local timezone, not UTC.
Anything outside the known token list passes through unchanged.
No. Formatting runs locally.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!