Stephen Colebourne's blog: Why JSR-310 isn't Joda-Time
One question that has been repeatedly asked is why JSR-310 wasn't simply the same as Joda-Time. I hope to expain some reasons here.
Joda-Time as JSR-310?
At its heart, JSR-310 is an effort to add a quality date and time library to the JDK. So, since most people consider Joda-Time to be a quality library, why not include it directly in the JDK?
Well, there is one key reason - Joda-Time has design flaws.
Now before everyone panics and abuses that line as a tweet, I need to say that Joda-Time is by far the best option curently available, and that most users won't appreciate the design flaws. But, I do want to document them, so the basis for the changes in JSR-310 is clear.
1) Human/Machine timelines
One element of clarity is a better understanding of the distinction between the two principle views of the timeline - Human and Machine.
Machines have one view - a single, ever increasing number. In Java we set zero as 1970-01-01T00:00Z and count in milliseconds from there.
Humans have a totally different view of time. We have multiple calendar systems (one primary, many others), which divide the timeline into years, months, days, hours, minutes and seconds. In addition, humans have time zones which cause the values to vary around the globe, and for there to be gaps and overlaps in the human timeline as DST starts and ends.
Read full article from Stephen Colebourne's blog: Why JSR-310 isn't Joda-Time
No comments:
Post a Comment