Timestamp to relative time
This tool turns a Unix timestamp — in seconds or milliseconds — into a
human-readable phrase like “3 hours ago” or “in 2 days”. It is built for
developers reading log lines, API responses or database created_at fields, where a
raw epoch number tells you nothing at a glance. It also shows the exact local date
and the ISO 8601 string so you can verify the conversion.
How it works
The input is parsed to milliseconds: in auto-detect mode, values of 10^12 or larger
are treated as milliseconds and smaller values as seconds (you can force either
unit). The tool then computes the gap between that moment and now and steps it up
through divisions — seconds, minutes, hours, days, weeks, months, years — stopping at
the first unit where the magnitude is below the next threshold. It uses the browser’s
built-in Intl.RelativeTimeFormat so the phrasing matches your locale (“yesterday”,
“last week”).
Example
The timestamp 1700000000 (seconds) is 14 November 2023, 22:13 UTC. Pasted today it
reads as roughly “2 years ago”, with the exact local date and ISO string shown
below.
| Gap from now | Relative phrase |
|---|---|
| 45 seconds ago | 45 seconds ago |
| 2 hours ago | 2 hours ago |
| 1 day ahead | tomorrow |
| 3 weeks ahead | in 3 weeks |
| 14 months ago | 1 year ago |
Everything runs in your browser; no timestamp leaves the page.