Is there a natural language parser for date/times in javascript?
+8
A:
Does Date.js satisfy your needs? Or are you looking for something else?
Nosredna
2009-06-16 18:56:26
I found that, but the source code scares me, on multiple levels. I was hoping for something that integrates with one of the 'modern' javascript libraries.
antony.trupe
2009-06-16 19:09:32
What scares you, the extension of native objects? Or something else?
Nosredna
2009-06-16 19:43:30
on the surface, the lack of formatting and/or lack of a development version and production version. Its also not an active project, which may not be relevant to everyone.
antony.trupe
2009-06-16 20:12:34
I've never seen anything close to it, though, especially all the localization. Let us know if you find something else. Maybe someone should take it over as a project.
Nosredna
2009-06-16 20:17:55
There were changes made in svn in late 2008, so it's not TOO far out of date.
Nosredna
2009-06-16 20:20:39
A:
The parse() method takes a date string and returns the number of milliseconds since midnight of January 1, 1970.
Date.parse("2009/04/01")
1238536800000
Date.parse("2009/04/01 13:00:00")
1238583600000
new Date(Date.parse("2009/04/01"))
Wed Apr 01 2009 00:00:00 GMT+0200
Spark
2009-06-16 19:02:24
@Spark Unfortunaly the user asked for a "natural language" parser. Something that could parse, say, "next friday at 8 pm" and return "2009-06-19 20:00"
Paulo Santos
2009-06-16 19:05:40