O'Reilly logo

OCA Java SE 8 Programmer Study Guide (Exam 1Z0-808) by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9

Dates and Times

Support for dates and times has been available since Java version 1.0, mainly through the java.util.Date class. However, Date was poorly designed. For examples, months in Date start at 1 but days start at 0. A lot of its methods were deprecated in JDK 1.1 at the same time the java.util.Calendar was brought in to take over some of the functionality in Date. The duo were the main classes for dealing with dates and times, right up to JDK 1.7, even though they had been considered inadequate and not easy to work with, causing many to resort to third party alternatives such as Joda Time (http://joda.org). The new Date and Time API in JDK 1.8 resolves many of the issues in the old API and is similar to the Joda Time API.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required