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 |
Where this tool is most useful
Log triage. Server logs, access files, and audit trails are full of Unix timestamps. Pasting one here immediately tells you whether an event was “10 minutes ago” or “last month” without mental conversion.
API response debugging. REST APIs frequently return created_at, updated_at, or expires_at as Unix epoch values. Converting a created_at to “3 days ago” tells you whether a record is fresh or stale at a glance.
Database inspection. PostgreSQL and SQLite both store timestamps as epoch integers in some schemas. When reviewing a row in a SQL editor, pasting the raw integer here shows you the human moment instantly.
Expiry checking. JWT tokens and OAuth tokens carry exp claims as Unix seconds. Paste the exp value to see “expired 2 hours ago” or “valid for another 4 days” without converting manually.
Seconds vs milliseconds: spotting the unit
If a timestamp looks like 1700000000 — ten digits — it is almost certainly in seconds. If it looks like 1700000000000 — thirteen digits — it is milliseconds. The auto-detect mode uses this digit count to pick the right unit. If you get a date near 1 January 1970 from a value that should be recent, switch the unit: you likely have milliseconds being read as seconds, which makes the value look like a moment just after the epoch.
A few APIs use microseconds (16 digits) or nanoseconds (19 digits). Those need to be divided by 1,000 or 1,000,000 respectively before pasting.
Everything runs in your browser; no timestamp leaves the page.