Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best JavaScript Date Parser & Formatter? [closed]

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?

like image 378
Elijah Manor Avatar asked Oct 15 '08 22:10

Elijah Manor


People also ask

Is moment or date-FNS better?

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.

Which library is used for date manipulation?

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.

What can I use instead of moment in JavaScript?

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.

What is date parse in JavaScript?

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.


1 Answers

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.

like image 167
Craig Avatar answered Sep 19 '22 04:09

Craig