Monday, July 27, 2009

Where is a tool for parsing date ranges in Java?

I'd like to turn this 20090701,20090703-20090710 into a list of dates in Java. It's not hard to do, but I hate writing code like this when I am just certain there's already a library for this.

Except I can't find one.

Any pointers for an open-source library to parse date ranges in Java would be much appreciated. I'm embarrassed to reinvent this whell.

2 comments:

Unknown said...

http://joda-time.sourceforge.net/api-release/org/joda/time/format/PeriodFormatterBuilder.html

?

Brian Oxley said...

Thanks, Paul -- I'll have to play with this. I definitely missed it. I need to work with lists and ranges of dates, not a single date, which is the tricky bit.