DataToolsLab
Date & Time Tools

Relative Time Formatter

Format dates as relative time like '2 hours ago' or 'in 3 days'.

Loading tool…

What is Relative Time?

A formatter that turns absolute instants into conversational relative phrases, the kind you see in chat apps and feeds.

How it works

It compares the input instant to now and picks the largest fitting unit (second → minute → hour → day → week), using Intl.RelativeTimeFormat for locale-aware output.

  1. Enter your input. Type or paste your input into the field above — the tool responds instantly.
  2. Review the result. Output updates live as you type. Everything runs entirely in your browser.
  3. Copy or download. Use the Copy button to grab the result, or Download to save it as a file.

Examples

Human-friendly timestamps

Format a timestamp as 3 hours ago or in 2 weeks — the phrasing used in feeds, dashboards, and notifications.

Common mistakes

Future vs past wording

Relative time splits into past (ago) and future (in) — the formatter picks the right direction and unit granularity automatically.

Frequently asked questions

Which units does it choose?

The largest sensible unit — seconds, minutes, hours, days, weeks, months, or years — with rounding rules you can preview.

Does it respect timezones?

The comparison is between instants, so it is timezone-independent; only the phrasing of the difference matters.

Can I convert back to an exact timestamp?

No — relative phrases are approximate by design. Use the Unix Timestamp Converter for exact values.

Online