O'Reilly logo

Java All-in-One For Dummies, 4th Edition by Doug Lowe

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 5

Working with Dates and Times

In This Chapter

arrow Understanding human and computer dates and times

arrow Using java.time classes to represent dates and times

arrow Comparing dates and times

arrow Performing calculations with dates and times

arrow 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 ...

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