Web features explorer

Intl.RelativeTimeFormat

Widely available since 2023-03-16
Tags: javascript Groups: JavaScript > Internationalization

The Intl.RelativeTimeFormat API creates a locale-aware formatter that turns an object representing a relative time (such as '1 day ago') into a localized string.

Learning resources on MDN

Browser support