Relative Time Calculator

Convert a date into relative time (e.g., '3 days ago', 'in 2 weeks')

About This Tool

Type a date or timestamp and the calculator returns a human phrase: '3 days ago,' 'in 2 weeks,' 'just now.' The phrasing matches Intl.RelativeTimeFormat conventions — the same logic Twitter, Slack, and most modern apps use to display when something happened.

The calculator shows the phrase in your browser's locale. English defaults to 'X ago' / 'in X'; other locales follow their own conventions. Switch the locale dropdown to see the phrase in any supported language.

For server logs and analytical contexts, exact timestamps are usually better than relative phrases — they're unambiguous, sortable, and don't drift as you read older content. Use relative time in UI where 'when' matters less than 'how long ago,' and absolute time everywhere else.

The threshold logic: under 60 seconds → 'just now' or 'in a moment.' 60-3600 seconds → minutes ('5 minutes ago,' 'in 10 minutes'). 3600-86400 seconds → hours. 86400-604800 seconds → days. 604800-2629800 → weeks. 2629800-31557600 → months. Beyond that → years. The exact thresholds are conventional, not standardized — Twitter, Slack, GitHub, and Discord each tune them slightly differently. Some apps switch to absolute date past 30 days; others keep relative through years. The calculator follows ICU/CLDR conventions, which match Intl.RelativeTimeFormat in modern browsers.

Worked example: a timestamp from 5 minutes ago renders as '5 minutes ago' in English, 'il y a 5 minutes' in French, '5 分前' in Japanese, 'hace 5 minutos' in Spanish. Each locale follows its own grammar — French uses 'il y a' as the past-time prefix, Japanese suffixes the unit, Spanish uses 'hace' similar to French. The calculator uses the host browser's Intl support, so all major locales work without any custom translation files. Now an 8-month-old timestamp: 'in -8 months' is wrong; the calculator outputs '8 months ago' (sign flipped to make the language natural). Future timestamps: 'in 3 days,' 'in 2 hours.' Same threshold logic, opposite sign.

When relative time fails: long-lived content (blog posts, documentation, reference articles). A blog post that says 'published 7 years ago' makes the content feel stale — even if it's still accurate, readers downweight it. Hybrid approach: show relative for recent items (under 30 days), absolute for older. Most CMS theme libraries support this pattern. Also: relative time is anchor-dependent. 'Posted 5 minutes ago' on a page you read at noon is wrong by midnight — the displayed phrase doesn't update unless the page recalculates. Use server-rendered absolute dates with client-side enhancement to relative-time, so users without JS still see something accurate.

The about text and FAQ on this page were drafted with AI assistance and reviewed by a member of the Coherence Daddy team before publishing. See our Content Policy for editorial standards.

Frequently Asked Questions