Gap in seconds
Δ = t(target) − t(reference)
Compare two dates and times and get the natural relative phrase (“3 months ago”, “tomorrow”, “in 2 hours”) together with the exact gap in days, hours, minutes and seconds.
Enter two valid date-times.
Relative time
Exact difference
“Posted 3 days ago”, “expires in 2 hours”, “updated 4 months ago”: interfaces and content often describe a date relative to a reference moment. This calculator compares two date-times and shows the relative phrase a browser would produce in your language, along with the exact gap in days, hours, minutes and seconds. Use it to check a label, write a notification or simply find out how much time separates two moments.
The tool first computes the real gap in seconds between the target and the reference (positive when the target is in the future). It then picks the largest unit reached: years from 365 days, months from 30 days, weeks from 7 days, then days, hours, minutes and seconds.
The gap is divided by the length of that unit and rounded to the nearest whole number, the same way in the past and in the future: 45 days give “in 2 months” just as they give “2 months ago”. A month counts as 30 days and a year as 365 days — average lengths, so the result is a readable approximation, not a calendar calculation.
The phrase comes from the browser’s Intl.RelativeTimeFormat API (ECMA-402 standard, wording from Unicode CLDR data) with the numeric option set to “auto”: a value of 1 or −1 becomes “tomorrow”, “yesterday”, “next week” or “last month”, and a zero gap becomes “now”. Dates are read in your device’s time zone.
This is “now” from the phrase’s point of view, for example the current time.
The event to place: in the past (… ago) or in the future (in …).
It is shown in the language of the page.
The breakdown in days, hours, minutes and seconds shows the rounding applied.
The value shown is the gap rounded in the largest unit reached.
Δ = t(target) − t(reference)
v = sign(Δ) × round(|Δ| ÷ u)
u is the largest unit such that |Δ| ≥ u.
Date libraries do not all use the same thresholds: some switch to months from 26 days or never show weeks. Two websites can therefore phrase the same gap differently.
Make sure a “2 months ago” shown by an app matches the real dates.
Get the natural phrasing of a deadline in the six languages of the site.
Find the exact gap between an order and its delivery, or between two logins.
Spot the effect of a daylight saving change on a one-day gap.
45 ÷ 30 = 1.5, rounded to 2.
Input
Reference 9 Oct 2026 12:00, target 23 Nov 2026 12:00Result
in 2 months (exact gap: 45 d)1.5 h is rounded to 2 h.
Input
Reference 12:00, target 13:30 the same dayResult
in 2 hours (1 h 30 min)1,012 days ÷ 365 ≈ 2.77, rounded to 3.
Input
Reference 9 Oct 2026, target 1 Jan 2024Result
3 years agoThe night of 28 to 29 March lasts only 23 h: the tool measures the time that actually elapses.
Input
Reference 28 Mar 2026 12:00, target 29 Mar 2026 12:00Result
in 23 hoursBeyond 30 days the gap is expressed in 30-day months and rounded: 45 ÷ 30 = 1.5, rounded to 2. The exact gap (45 d) is still shown below the phrase.
Months only start at 30 days. Between 7 and 29 days, the gap is expressed in weeks: 29 ÷ 7 ≈ 4.1, rounded to 4.
Because a daylight saving change happened between the two dates. The tool measures the time that actually elapsed in your device’s time zone.
When the rounded gap is exactly −1 or +1 day. The same goes for “last week”, “next month” or “next year”.
From the browser’s Intl.RelativeTimeFormat API, defined by the ECMA-402 standard and fed by Unicode CLDR language data.
The fields are entered to the minute, but the gap is computed in seconds; under one minute the result is expressed in seconds or as “now”.
Related tools
Tools similar or complementary to this one.
Calculate the time between two dates in years, months and days, in total days and in weeks.
Find out how many days are left until a date, or how many have passed since, with the equivalent in weeks.
Convert a Unix timestamp to a readable date and time, or a date to a timestamp, in seconds or milliseconds.
Date differences, durations, business days, ISO weeks, recurrences and formats: choose the right date and time calculation.
Understand common date formats, avoid international ambiguity and learn when to use local dates, ISO 8601 or Unix timestamps.
Understand the difference between a clock time and a duration, calculate intervals between times, and convert seconds, minutes, hours, days and weeks.
Understand ISO 8601 week numbers, Unix timestamps in seconds or milliseconds, and the difference between human-readable dates and technical time values.