Intl.RelativeTimeFormat Playground

"yesterday", "3 days ago", "in 2 hours": time phrases per language, from the browser. You pick the value and the unit. An interactive Intl.RelativeTimeFormat…

Why it matters

Almost every app writes "posted X ago" or "due in Y". Building it yourself means nested if-else, wrong grammar in other languages, and forgetting words like "yesterday" or "the day after tomorrow". RelativeTimeFormat writes the right phrase per language, as long as you give it the right value and unit.

The key idea

RelativeTimeFormat only writes; you pick the value and the unit

Common mistakes

Try it in this playground