Relative Time Calculator
About this tool
About Relative Time Calculator
See any date the way social apps and inboxes show it: “3 days ago”, “yesterday”, “in 2 weeks”, “last month”. Pick a date and time, compare it with now (updating live) or with another date, and the tool picks the natural unit the way products do, or you can force a unit such as days or hours. The same phrase is shown in more than twenty languages, including Hindi, Bengali, Tamil, Spanish, Arabic, Japanese and Chinese, in long, short or narrow style, and with natural wording (“yesterday”) or always numeric (“1 day ago”). The phrases come straight from your browser's Intl.RelativeTimeFormat, so developers can check exactly what their own code will print before shipping it. The exact difference is also shown in days, hours, minutes and seconds. The reverse calculator answers questions like “what date was 90 days ago?” or “what date is 6 weeks from now?”. Nothing is uploaded.
Built and maintained by Abhi JainUpdated
How to Show a Date as Relative Time
- 1
Pick the date
Choose a date and time. Keep Compare with now on, or pick another reference date.
- 2
Choose the wording
Pick Best fit or a fixed unit, natural or numeric wording, and long, short or narrow style.
- 3
Copy the phrase
Copy the English result or any language from the list. Use Reverse to find a date from “N units ago”.
Relative Time Calculator: questions and answers
What date was 90 days ago?
In Reverse, enter 90, choose days and ago. The date is shown immediately for today's date, with a copy button for ISO format.
How does “best fit” choose the unit?
Under 45 seconds it uses seconds, under 45 minutes minutes, under 22 hours hours, under 7 days days, under 4 weeks weeks, under 11 months months, and years after that, which matches common libraries.
How do I do this in JavaScript?
new Intl.RelativeTimeFormat('en', { numeric: 'auto' }).format(-3, 'day') returns “3 days ago”. With numeric: 'auto', -1 day becomes “yesterday”.
Why is “last month” shown instead of “1 month ago”?
That is the natural (numeric: auto) wording. Switch Wording to Numeric to always get a number.
Related Tools
- Date FormatterFormat a date as ISO 8601, RFC 2822, Unix time, locale styles or a custom strftime or token pattern.
- Date Difference CalculatorYears, months, weeks and days between two dates, with an option to include the end date.
- Countdown to DateA live countdown to any date and time, shareable as a link.
- Add or Subtract DaysAdd or subtract days, weeks, months, years or business days to find a date.