How do you format a date range in Java?
问题 I have two dates - a start and an end. I'd like to format them so that if the months match, they collapse to something like "20-23 AUG" and still format correctly if they break over the end of the month, like "20 SEP - 1 OCT". Are there any libraries out there for accomplishing this, or would I have to hand code rules for displaying ranges of dates using individual DateFormats? 回答1: Here's a solution using JodaTime, the best library for dealing with dates in Java (last time I checked). The