4.6. Working with calendar data

[9.3] Create and manipulate calendar data using classes from java.time.LocalDateTime, java.time.LocalDate, java.time.LocalTime, java.time.format.DateTimeFormatter, java.time.Period3

The new Date and Time API in Java 8 simplifies working with date and time objects. It includes classes and interfaces with simple and informative method names. As you work with the classes LocalDate, LocalTime, LocalDateTime, Period, and DateTimeFormatter in this section, you’ll notice that these classes define methods with similar names (which have similar purposes). Table 4.1 lists the method prefix, its type, and its use (from Oracle Java documentation).

Table 4.1. Method prefixes, types, and their uses in the ...

Get OCA Java SE 8 Programmer I Certification Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.