Relative Time Generator
Turn a timestamp into '2 hours ago'
The phrasing a feed or a comment thread uses, in any locale, with the thresholds shown — and a note on when relative time is the wrong choice.
Questions people ask
The things that come up about relative time generators, answered plainly.
How does the rounding work?
Each unit is used until the next one is a whole number: under a minute is 'just now', then minutes to an hour, hours to a day, and so on. The thresholds are listed on the page, since the exact boundaries are what make two implementations disagree.
When should I not use relative time?
Anything older than about a week, and anything a reader might need to act on or cite. '3 months ago' is useless for finding a record; a date is not. Most interfaces should show relative time recently and an absolute date after that.
How do I localise it?
Use `Intl.RelativeTimeFormat`, which is what this page uses. Building the phrase by concatenating a number and a word breaks in every language with grammatical number beyond one and many.
Related tools
Julian days, Excel serials, GPS time, cron expressions and format validators.