O'Reilly logo

Java 8 in Action: Lambdas, streams, and functional-style programming by Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft

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 12. New Date and Time API

This chapter covers

  • Why we needed a new date and time library in Java 8
  • Representing date and time for both humans and machines
  • Defining an amount of time
  • Manipulating, formatting, and parsing dates
  • Dealing with different time zones and calendars

The Java API includes many useful components to help you build complex applications. Unfortunately, the Java API isn’t always perfect. We believe the majority of experienced Java developers will agree that date and time support before Java 8 was far from ideal. Don’t worry, though; Java 8 introduces a brand new Date and Time API to tackle this issue.

In Java 1.0 the only support for date and time was the java.util.Date class. Despite its name, this class doesn’t ...

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