JavaScript
Format Relative Time
Returns a human-readable relative time string ("3 days ago", "in 2 hours") using the Intl.RelativeTimeFormat API. Automatically selects the most appropriate unit (seconds, minutes, hours, days, weeks, months, years) based on the elapsed time. Fully localised — pass any BCP 47 locale.