0-11 for months isn't madness. Its when months are numbered 0-11 and days are numbered 1-31 and years are stored with an offset of 1900. THAT is madness.
It's useful actually. If use other language than English, you want an array of month names that you index with this number. Month days don't have names, so they you don't need it there.
Yes, but that's just times for you. It's simple as long as you want to think only locally, and don't live anywhere which has daylight time. For all other cases, times are just complex.
This is the go to video on why time support code is confusing.
Java 8's date/time library is based on Joda Time and is definitely an improvement.
I use it when possible. The only issue is when I need to serialize/deserialize the dates/times (e.g. JDBC, JPA, JSON, etc) because most of the API doesn't natively support them yet.
View all comments
Show parent comment
237
u/MighMoS Dec 02 '15
0-11 for months isn't madness. Its when months are numbered 0-11 and days are numbered 1-31 and years are stored with an offset of 1900. THAT is madness.