views:

246

answers:

3

Is there a natural language parser for date/times in ColdFusion?

+2  A: 

I believe parseDateTime() and lsParseDateTime() are the closest to what you're looking for, from the library of built-in ColdFusion functions.

Check out Adobe's LiveDocs for other date/time functions.

Remember that you can also leverage any Java date/time class as well. Pete Freitag has an interesting post with some example code.

Jamie Krug
natural language, as in tomorrow, yesterday, one week from today, etc.
antony.trupe
@antony- please specify that in the original question if that's what you want. when you said "natural language", i thought that meant that it can parse a string in any format naturally used. i.e. the user could enter "1/11/94" or "january 11, 1994" or "1994.01.11" or whatever, and the parser would be smart enough to figure out the format.
Kip
added link to Wikipedia article on NLP
antony.trupe
+7  A: 

There's a (reportedly -- I've not used it) good one for Java called JChronic -- a port of the Ruby Chronic date parser. You could try using it.

It hasn't been updated since 2006, but should still be useful.

Ben Doom
JChronic sounds neat.. thanks for sharing!
Jas Panesar
A: 

Since you are probably using it in a form anyway checkout Datejs, a very nice javascript date library that can parse a lot of dates. It is very easy to incorporate with CF.

kevink