问题
Is there a natural language parser for date/times in ColdFusion?
回答1:
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.
回答2:
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.
回答3:
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.
来源:https://stackoverflow.com/questions/1003330/is-there-a-natural-language-parser-for-dates-times-in-coldfusion