Check Day.js formats, strict parsing, localized output, local vs UTC behavior and relative time before the date contract lands in code.
Day.js is small, familiar and plugin driven, but production bugs often come from the small details: a missing customParseFormat plugin, a locale applied globally, a UTC timestamp rendered as local time or a format token that looks right but describes the wrong contract. This playground keeps those decisions visible.
The evaluator runs in the browser. The page does not send pasted dates, formats or snippets to a backend and does not store history.
Choose a preset, adjust the input, parse format, output format, locale and mode, then compare local, UTC, localized and relative output.
Start from an ISO timestamp and inspect a common dashboard format.
2026-05-26 09:30:00
2026-05-26 09:30:00Uses the runtime/browser local timezone.
2026-05-26 09:30:00Parses and formats through dayjs.utc(...).
Tuesday, May 26, 2026 9:30 AMUses the selected locale on the value instance.
a few seconds agoComputed from the deterministic referenceNow field.
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import utc from 'dayjs/plugin/utc';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import relativeTime from 'dayjs/plugin/relativeTime';
import advancedFormat from 'dayjs/plugin/advancedFormat';
dayjs.extend(customParseFormat);
dayjs.extend(utc);
dayjs.extend(localizedFormat);
dayjs.extend(relativeTime);
dayjs.extend(advancedFormat);
const value = dayjs("2026-05-26T09:30:00Z").locale("en");
const output = value.format("YYYY-MM-DD HH:mm:ss");Tokens such as YYYY, MM, DD, HH, mm, ss, Z, dddd and LLL communicate a contract. Keep the intended output visible before copying it into API docs, UI labels or release scripts.
A timestamp with Z can look different in local mode than in UTC mode. Compare both before using a value in payloads, logs or release notes.
Day.js locales and plugins are explicit. This playground shows customParseFormat, utc, localizedFormat, relativeTime and advancedFormat so the snippet does not hide setup work.
Date strings often travel through formatted code and JSON payloads. Use the neighboring tools when the contract is broader than one Day.js expression.
No. The MVP is intentionally scoped to local vs UTC and locale output. A full timezone lab would be a separate product.
Relative time must be reproducible. A fixed reference date makes tests, docs and review comments deterministic.
No. The evaluator applies locale on the Day.js instance so tests and SSR requests do not inherit a hidden global locale.
No. Use it to inspect a date contract, then keep final parsing and formatting behavior covered in normal unit tests.