January 24, 2021
A relative date is something like "23 minutes ago", "1 day ago", or "3 months ago".
My favorite Node.js package for formatting a normal
Date object into a nice string is tiny-relative-date.
First, install the package:
npm install tiny-relative-date
Then, you can use it like this:
Done! Now you've got relative dates in Node.js.
A quick favor: was anything I wrote incorrect or misspelled, or do you still have questions? Please use this form to let me know or ask for help!