Tool Hub

Relative Time

Test Intl.RelativeTimeFormat output (e.g. '2 days ago')

Generate human-readable relative time strings (e.g. "3 hours ago", "in 2 days") from a timestamp or date. Useful for previewing how timeago-style labels render across locales and offsets.

LocaleResult
en-US3 days ago
en-GB3 days ago
zh-CN3天前
zh-TW3 天前
es-EShace 3 días
hi-IN3 दिन पहले
pt-BRhá 3 dias
fr-FRil y a 3 jours
de-DEvor 3 Tagen
ja-JP3 日前
ko-KR3일 전

How to use

  1. Enter a numeric value in the value field; negative numbers mean the past, positive numbers mean the future.
  2. Select a time unit from the dropdown: second, minute, hour, day, week, month, quarter, or year.
  3. Read the table to compare how Intl.RelativeTimeFormat renders the duration across 11 locales.
  4. Note that the 'auto' style returns natural-language phrases like 'yesterday' or 'last month' when applicable.

Examples

  • Entering -1 with unit 'day' shows 'yesterday' in en-US, 'hier' in fr-FR, and '어제' in ko-KR.
  • Entering 3 with unit 'month' shows 'in 3 months' in en-US and corresponding translations across all 11 locales.

Verify outputs before using in production. No warranty — see Terms.