Is there a natural language parser for date/times in javascript?
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.
JavaScript Date toString()The toString() method returns a date object as a string.
In Node. js date and time are handled with the Javascript Date object. It is loaded by default and requires no import of modules.
I made Chrono a small library for parsing dates in JavaScript. I added a date range parsing feature (such as '12 Nov - 13 Dec 2012') .
SugarJS supports some natural language parsing of dates and times.
You can jump to the live example here: http://sugarjs.com/dates
For example, it supports the following inputs:
You can then covert the result into different date formats or use the API to further manipulate the date.
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