Introducing
The Slant team built an AI & it’s awesome
Find the best product instantly
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now
4.7 star rating
0
Development
Frontend Development
What are the best JavaScript date formatting libraries?
6
Options
Considered
13
User
Recs.
Oct 24, 2020
Last
Updated
Related Questions
Activity
Have feedback or ideas?
Join our community
on Discord
Ad
6
Options
Considered
Best JavaScript date formatting libraries
Price
Last Updated
--
date-fns
Free
Aug 12, 2020
--
Moment.js
-
Apr 15, 2020
--
Chronos
Free
Oct 24, 2020
--
Datejs
-
Aug 25, 2015
--
Luxon
Free
Sep 12, 2018
See Full List
--
date-fns
My Rec
ommendation
for
date-fns
My Recommendation for
date-fns
All
3
Pros
2
Cons
1
Top
Pro
•••
Modular
Developers can pick only the functions they need to reduce the size of the library that's being downloaded (using bundlers such as webpack or browserify)
See More
Top
Con
•••
Their "distance in words" function is not very customizable
When comparing a certain date to the current date the function returns a pretty "opinionated" sentence such as "almost 2 years" which can't really be customizable and requires string manipulation to fit result to your needs.
See More
Top
Pro
•••
Immutable
Uses pure functions and always returns a new date object to prevent unexpected results.
See More
Hide
See All
Free
Recommend
8
--
Moment.js
My Rec
ommendation
for
Moment.js
My Recommendation for
Moment.js
All
3
Pros
2
Cons
1
Top
Con
•••
Relatively big library
The library has to be downloaded in full (currently ~16KB minified and compressed) which includes lots of functions that the user doesn't necessarily need or want.
See More
Top
Pro
•••
Open source
Moment.js is open source and free to use.
See More
Top
Pro
•••
Customizable
Moment allows you to customize almost anything which is very helpful.
See More
Hide
See All
Get it
here
Recommend
3
1
--
Chronos
My Rec
ommendation
for
Chronos
My Recommendation for
Chronos
All
5
Experiences
1
Pros
3
Cons
1
Top
Pro
•••
Fully functional
See More
Top
Con
•••
Sadly but for strings formatting only Russian locale is supported
But everything else works fine.
See More
VersatileAbhean's Experience
It's lightweight and contains everything I need!
See More
Top
Pro
•••
TypeScript
See More
Top
Pro
•••
Lightweight
See More
Hide
See All
Free
Recommend
1
--
Datejs
My Rec
ommendation
for
Datejs
My Recommendation for
Datejs
Hide
Get it
here
Recommend
--
Luxon
My Rec
ommendation
for
Luxon
My Recommendation for
Luxon
All
4
Pros
3
Cons
1
Top
Pro
•••
Time zone support
Claims to be the best date formatting library at handling time zones
See More
Top
Con
•••
Lacks relative date formatting functions
Luxon currently doesn't have any relative date formatting functions (e.g. from(time), to(time), fromNow(), toNow(), etc..). Its creators are waiting for modern browsers to implement the Relative Time Format which can take a while.
See More
Top
Pro
•••
Explicit API
Function names describe exactly what they do so it's easier to work with.
See More
Top
Pro
•••
Immutable
All types in Luxon are immutable making it more predictable.
See More
Hide
See All
Free
Recommend
--
XDate
My Rec
ommendation
for
XDate
My Recommendation for
XDate
Hide
Get it
here
Recommend
Don't see your favorite option? Add it.
Built By the Slant team
Find the best product instantly.
4.7 star rating
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now - it's free
One sec!
Are you sure that you want to abandon your hard work?
Delete Work
Continue working
{}
undefined
url next
price drop