Chapter 12
The Date and Time API
Topics in This Chapter
Time flies like an arrow, and we can easily set a starting point and count forwards and backwards in seconds. So why is it so hard to deal with time? The problem is humans. All would be easy if we could just tell each other: “Meet me at 1371409200, and don’t be late!” But we want time to relate to daylight and the seasons. That’s where things get complicated. Java 1.0 had a Date
class that was, in hindsight, naïve, and had most of its methods deprecated in Java 1.1 when a Calendar
class was introduced. Its API wasn’t stellar, ...
Get Core Java for the Impatient, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.