Chapter 5
Working with Dates and Times
In This Chapter
Understanding human and computer dates and times
Using java.time classes to represent dates and times
Comparing dates and times
Performing calculations with dates and times
Formatting dates and times
Does anybody really know what time it is? Does anybody really care about time?
So mused Robert Lamm of The Chicago Transit Authority (later known as simply Chicago) in 1969.
I'm not sure who cared much about time in 1969, but I do know that the people who designed the original version of Java in 1995 didn't care much about it, at least as evidenced by the weak classes they provided for working with times and dates in the Java.util package. Java programmers have long struggled with simple calculations involving dates and times, such as determining what the date will be 45 days from today or calculating the number of days between two given dates.
Java 8 changes all that. Java 8 provides an entirely new framework for working with dates ...
Get Java All-in-One For Dummies, 4th 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.