JS Built-ins
IntlRelativeTimeFormatbeginner

Create RelativeTimeFormat

πŸ“– Usage Example
const rtf = new Intl.RelativeTimeFormat('en', { numeric: 'auto' });
// Creates a relative-time formatter

Intl.RelativeTimeFormat formats durations like '3 hours ago' or 'in 2 days'.

Create an Intl.RelativeTimeFormat instance.

πŸ’‘ Hints (1)
  • β€’ Use new Intl.RelativeTimeFormat(locale)