A timely interlude

Prior to Java 8, two primary date-related classes were Date and Calendar (and, of course, GregorianCalendar). The new java.time package offers several new classes, such as Duration, Period, Clock, Instant, LocalDate, LocalTime, LocalDateTime, and ZonedDateTime. There is a plethora of supporting classes, but these are the primary starting points. Let's take a quick look at each.

Get Java 9: Building Robust Modular Applications 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.