Java Dates and other crap
Is it just me who thinks that the java time/date/calendar handling just sucks? Here are some points that come to my mind straight away…
- The distinction between date and time is blurry. Basically because there is no Time object that just takes the hour, second and millisecond values.
- Why are the explicit constructors of the Date object deprecated. Well, probably because java aims to support different Calendars. Fine! But where is the connection between them. Shouldn’t the Calendar then act as Date-Factory?
- Let’s say you want to increase you position in the timeline by one day. What you want to do is to add a day to the date which reflects a certain point inside the Calendar. But with the current API you add it to the calendar. Just think about this sentence and you see how awkward this is. Using the Calendar object as the main computation object just feels wrong.
- …I could go on and on
Does anyone know a good alternative? Google revealed the joda time API which on the first glance looks much better. Any other suggestions?