Time Ago (Relative Time)
Turn any past date and time into a clear relative phrase like "3 days ago", plus a full breakdown of the elapsed interval in every unit.
3 days ago
- 1
Elapsed time in seconds
|now − past| = 259,221.6 sAbsolute difference between the two timestamps. - 2
Convert to days
259,221.6 ÷ 86,400 = 3.0002 - 3
Floor to whole units
floor(3.0002) = 3
How does this calculator work?
Time ago is the gap between now and a past moment, expressed with the largest fitting unit: diff = now − past, then value = floor(diff / unit). Units step up from seconds to years using thresholds of 60, 60, 24, 7, ~30.44, and 365.25 days, giving phrases like "3 days ago" plus a full breakdown.
Formula
How this is calculated
The calculator parses the past date and time you enter and an optional reference time. If you leave the reference blank it uses the current moment. The difference is computed in milliseconds as reference minus past, so a positive value means the past date is behind the reference and a negative value means it is ahead (shown as "from now").
To choose the relative phrase it picks the largest unit that fits the absolute difference, using these thresholds: under 60 seconds shows seconds; under 60 minutes shows minutes; under 24 hours shows hours; under 7 days shows days; under one month (averaged at 30.44 days) shows weeks; under one year (365.25 days) shows months; otherwise years. The displayed value is the floor of the difference divided by that unit, so partial units are dropped just like everyday speech ("3 days ago", not "3.4 days ago").
Months and years use averaged lengths (30.44 and 365.25 days) to account for varying month lengths and leap years, so they are approximations rather than exact calendar counts. The breakdown grid restates the same interval in seconds, minutes, hours, days, weeks, months, and years as exact fractional totals for precise work.
Frequently asked questions
Calendar months range from 28 to 31 days and years can include a leap day, so the calculator uses average lengths of 30.44 days per month and 365.25 days per year. This keeps the relative phrase consistent but means month and year totals are estimates, not exact calendar differences.
If the past date is actually later than the reference time, the difference is negative. The calculator still works: it uses the absolute interval and labels the phrase "from now" instead of "ago".
Any string the browser can parse works, but ISO 8601 like 2026-06-24T09:00 is the most reliable across devices. Leave the reference field blank to compare against the current moment.
Also known as
TG we-Calculate Editorial Team. (2026). Time Ago (Relative Time) [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/time-ago
TG we-Calculate Editorial Team. "Time Ago (Relative Time)." TG we-Calculate. 2026. https://we-calculate.com/calculator/time-ago.
TG we-Calculate Editorial Team, "Time Ago (Relative Time)," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/time-ago
@misc{wecalculate_time_ago, title = {Time Ago (Relative Time)}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/time-ago}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
