Timestamp to Relative Time Converter

Turn a Unix timestamp into "3 hours ago" or "in 2 days".

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

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 nowRelative phrase
45 seconds ago45 seconds ago
2 hours ago2 hours ago
1 day aheadtomorrow
3 weeks aheadin 3 weeks
14 months ago1 year ago

Everything runs in your browser; no timestamp leaves the page.

Ad placeholder (rectangle)