Boneyard Tools

How 'time ago' formatting works, and its trade-offs

Why relative time uses the largest unit that fits, how approximate months and years round, and when to prefer an absolute date instead.

Picking the largest unit that fits

Relative time is meant to be read at a glance, so it never lists every unit at once. Instead it finds the largest whole unit that fits the gap and stops there. A difference of two hours and forty minutes is simply '2 hours ago', because hours is the biggest unit that divides the gap at least once. This tool checks units from largest to smallest, years down to minutes, and returns the first one that fits with a whole count of one or more. That is why you never see a compound phrase like '2 hours and 40 minutes', only the single dominant unit.

Why it floors instead of rounding

The count is always rounded down to a whole unit, not rounded to the nearest one. A gap of ninety minutes reads as '1 hour ago' because only one full hour has actually elapsed, even though rounding to the nearest hour would say two. Flooring matches how people naturally describe elapsed time: you are 'in your thirties' the day you turn thirty, not the day you approach forty. The trade-off is that a value just short of the next unit, such as fifty-nine minutes, still reports the smaller unit until the boundary is truly crossed.

Approximate months and years

Calendar months are messy: they range from twenty-eight to thirty-one days, and years can be leap years. To keep phrases short and stable this tool treats a month as thirty days and a year as three hundred and sixty-five days. That approximation is fine for casual phrasing like 'posted 2 months ago', but it drifts from a strict calendar near boundaries. Roughly forty-five days shows as one month, and a leap year is not counted as an extra day. If you need an exact count of calendar months or years between two dates, use a dedicated date-difference or age calculator instead.

When relative time is the wrong choice

Relative phrasing is friendly but it hides the actual date, and it goes stale the moment the clock moves on. 'Posted 3 hours ago' is helpful in a feed you are reading right now, but useless in a document someone opens next week. For records, receipts, legal dates or anything archived, show an absolute timestamp like a full date and time, and consider pairing it with the relative phrase for quick scanning. This tool freezes its comparison to a fixed reference so the phrase does not shift while you read, and the 'Refresh now' button lets you deliberately re-anchor it to the present.

Frequently asked questions

Why does 45 days show as '1 month ago'?

A month is approximated as 30 days, so 45 days is one full 30-day span plus a remainder that is not enough for a second month. The tool floors to the largest whole unit, giving one month.

Can I get seconds-level precision?

No. Anything under one minute is reported as 'just now'. If you need seconds, use a stopwatch or countdown tool, since relative phrasing is designed for glanceable, human-scale intervals.

Should I store relative time in a database?

No. Store an absolute timestamp, then compute the relative phrase when you display it. Relative strings go stale immediately and cannot be sorted or compared reliably.