Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fuzzy date parsing with Java

Are there any libraries for Java that allow you to interpret dates like "Yesterday", "Next Monday", ...

like image 703
carrier Avatar asked Jul 27 '09 15:07

carrier


3 Answers

You are looking for Natty. Feel free to fork it and modify its grammar.

like image 135
pathikrit Avatar answered Nov 20 '22 07:11

pathikrit


Su-time from stanford is your (and my) friend.

like image 26
YaDa Avatar answered Nov 20 '22 06:11

YaDa


A library like Joda-Time is probably as close as you're gonna get. It doesn't convert strings, but offers much more functionality than the Java default Date class.

Here is a utility class that provides some of the functions you're looking for, but again without fuzzy string conversion.

like image 1
Daniel F. Thornton Avatar answered Nov 20 '22 07:11

Daniel F. Thornton