Formatting relative time in JavaScript

Did you know JavaScript has a built-in way to format relative time? It’s called Intl.RelativeTimeFormat and it’s awesome!


This content originally appeared on 30 seconds of code and was authored by 30 seconds of code

Did you know JavaScript has a built-in way to format relative time? It's called Intl.RelativeTimeFormat and it's awesome!


This content originally appeared on 30 seconds of code and was authored by 30 seconds of code


Print Share Comment Cite Upload Translate Updates
APA

30 seconds of code | Sciencx (2025-04-24T00:00:00+00:00) Formatting relative time in JavaScript. Retrieved from https://www.scien.cx/2025/04/24/formatting-relative-time-in-javascript/

MLA
" » Formatting relative time in JavaScript." 30 seconds of code | Sciencx - Thursday April 24, 2025, https://www.scien.cx/2025/04/24/formatting-relative-time-in-javascript/
HARVARD
30 seconds of code | Sciencx Thursday April 24, 2025 » Formatting relative time in JavaScript., viewed ,<https://www.scien.cx/2025/04/24/formatting-relative-time-in-javascript/>
VANCOUVER
30 seconds of code | Sciencx - » Formatting relative time in JavaScript. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/04/24/formatting-relative-time-in-javascript/
CHICAGO
" » Formatting relative time in JavaScript." 30 seconds of code | Sciencx - Accessed . https://www.scien.cx/2025/04/24/formatting-relative-time-in-javascript/
IEEE
" » Formatting relative time in JavaScript." 30 seconds of code | Sciencx [Online]. Available: https://www.scien.cx/2025/04/24/formatting-relative-time-in-javascript/. [Accessed: ]
rf:citation
» Formatting relative time in JavaScript | 30 seconds of code | Sciencx | https://www.scien.cx/2025/04/24/formatting-relative-time-in-javascript/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.