Intl.RelativeTimeFormat
Widely available since 2023-03-16
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
- Chrome 71 Released on 2018-12-04
- Chrome Android 71 Released on 2018-12-04
- Edge 79 Released on 2020-01-15
- Firefox 76 Released on 2020-05-05
- Firefox for Android 79 Released on 2020-07-28
- Safari 14 Released on 2020-09-16
- Safari on iOS 14 Released on 2020-09-16
Specifications
- ECMAScript Internationalization API Specification (#relativetimeformat-objects), from TC39 (Ecma International).