How to set little-endian (DMY) in Natty or JChronic or other natural language date parser?

305 Views Asked by At

Given the requirement to parse input strings such as "a week from now" and "20/05/15" into Date objects in Java, Natty and JChronic seem to be my main options.

However both of them default to parsing "01/12/15" as 12th of January rather than 1st of December, i.e. middle-endian or MDY. Ruby's Chronic library has :endian_precedence => [:little, :median] option to reconfigure this behaviour however I cannot find anything similar in Natty or JChronic. Their constructor do take TimeZone and Calendar respectively but this does not seem to have an effect on the parser, neither does default locale of the machine.

How do I configure either of them to parse "01/12/15" in little-endian DMY format? Is there a third natural language date parser library in Java that can do that?

0

There are 0 best solutions below