Since I've started to use jQuery, I have been doing a lot more JavaScript development.
I have the need to parse different date formats and then to display them into another format.
Do you know of any good tool to do this?
Which one would you recommend?
Date-fns vs MomentJS Performance As you can see, Date-fns are well ahead in all 3 operations in terms of operations performed per second and size and the simple API is the main reason behind this.
Luxon. Luxon is a date-time manipulation library created by one of the Moment. js developers to suit modern application requirements. Similar to Date-fns, Luxon offers data formatting and parsing functions.
There are several libraries out there that can potentially replace Moment in your app. The creators of Moment recommend looking into Luxon, Day. js, date-fns, js-Joda, or even replacing Moment with native JS.
parse() The Date. parse() method parses a string representation of a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC or NaN if the string is unrecognized or, in some cases, contains illegal date values (e.g. 2015-02-31). Only the ISO 8601 format ( YYYY-MM-DDTHH:mm:ss.
2014 update: Moment.js is an excellent date manipulation library, which includes parsing functions. It doesn't include automatic date format detection, but you can specify multiple parsing patterns.
Do you know the format of the dates before hand though, or are they user input?
A deprecated library for parsing dates is Datejs. It hasn't been updated since 2007.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With