Relative Time (Time Ago) Formatter
Format any timestamp as a relative phrase ('2 hours ago', 'in 3 days', 'just now') across 5 locales (en, es, fr, de, ja) with auto unit selection, configurable thresholds, numeric 'always' vs 'auto' modes, multi-locale preview grid, and copy-paste code snippets for Intl.RelativeTimeFormat, Luxon, Day.js, and date-fns. 100% client-side.
About Relative Time (Time Ago) Formatter
Format any timestamp as a relative phrase ('2 hours ago', 'in 3 days', 'just now') across 5 locales (en, es, fr, de, ja) with auto unit selection, configurable thresholds, numeric 'always' vs 'auto' modes, multi-locale preview grid, and copy-paste code snippets for Intl.RelativeTimeFormat, Luxon, Day.js, and date-fns. 100% client-side. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
How does the relative time formatter pick the unit automatically?
We compute the signed difference in milliseconds, then walk the unit ladder (second → minute → hour → day → week → month → year) using configurable thresholds. By default: ≤45s is 'just now' (numeric:auto → 'now'), <90s uses seconds, <45min uses minutes, <22h uses hours, <7d uses days, <26d uses weeks, <11mo uses months, otherwise years. The result is passed to Intl.RelativeTimeFormat so pluralization, gender, and inflection are handled by CLDR.
What is the difference between numeric 'always' and 'auto'?
Intl.RelativeTimeFormat accepts a numeric option. 'always' (default in the API) renders every value literally: format(0, 'second') → 'in 0 seconds'. 'auto' uses idiomatic phrasing where available: format(0, 'second') → 'now', format(-1, 'day') → 'yesterday' (en), 'ayer' (es), 'hier' (fr), 'gestern' (de), '昨日' (ja). This tool exposes both via a single toggle so you can preview the exact string each mode produces.
Which locales are supported?
Five locales with full CLDR coverage are bundled: English (en), Spanish (es), French (fr), German (de), and Japanese (ja). The multi-locale preview grid renders your timestamp in all five at once so you can compare phrasing, plural rules, and 'yesterday'/'tomorrow' idioms side by side. The generated Intl snippet can be edited to use any BCP-47 tag (e.g. 'zh-CN', 'ar', 'pt-BR').
Does the generated code snippet run as shown?
Yes. The Intl.RelativeTimeFormat snippet uses only the native browser API — no dependencies. The Luxon snippet requires luxon (DateTime.fromMillis(ts).toRelative({ locale })). The Day.js snippet requires dayjs plus the relativeTime plugin (dayjs(ts).fromNow()). The date-fns snippet requires date-fns and the matching locale object (formatDistance(ts, Date.now(), { addSuffix: true, locale })). All four are copy-paste runnable.
What extra features does this tool have versus raw Intl.RelativeTimeFormat?
(1) Auto unit selection (the native API makes you pick). (2) Configurable thresholds (justNow, minute, hour, day, week, month, year cutoffs). (3) numeric 'always' vs 'auto' toggle. (4) Three style modes (long, short, narrow). (5) Multi-locale preview grid (5 locales at once). (6) Code snippet generator for 4 libraries. (7) Full breakdown table (years/months/weeks/days/hours/minutes/seconds totals). (8) Sample-date presets. (9) localStorage history (max 20). (10) Shareable URL with full option round-trip. (11) Future-vs-past direction indicator. (12) Copy / download as .txt. 100% client-side.
Related tools
.bashrc / .zshrc Alias & Config Manager
Build shell aliases, functions, exports, and PATH edits in a visual editor, then export a clean, commented .aliases file sourced from both .bashrc and .zshrc — with shadowing detection against shell builtins and common CLI tools, function suggestions when args are needed, starter packs (git, docker, kubectl, navigation, safety, ls, dev, devops, data science), import of existing rc files, dedupe, history (localStorage), and shareable URL. 100% client-side.
Add / Subtract Date Calculator
Add or subtract years, months, weeks, days, hours, minutes and seconds from a starting date/time. Calendar-day or business-day mode with custom weekend + holiday list. Month-end policy toggle (clamp to last day vs overflow). Repeat/series mode (e.g. every 2 weeks x 10) with CSV export. Shareable URL. 100% client-side.
Age Calculator
Calculate exact age from a birth date in calendar years/months/days (no negative-day bugs) plus totals in months/weeks/days/hours/minutes/seconds. Next-birthday countdown with weekday. Feb-29 birthday policy toggle. Milestones (1,000 days, 10,000 days, 1 billion seconds). Zodiac sign + Chinese zodiac. Age gap comparison. Shareable URL. 100% client-side.