Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java 8+ Date and Time API - Coggle Diagram
Java 8+ Date and Time API
Improvement
Thread safety
new Date and Time APIs introduced in Java 8 are immutable
API design and ease of understanding
There are a wide variety of utility methods that support the most common operations.
ZonedDate and Time
LocalDate
date in ISO format (yyyy-MM-dd) without time
LocalTime
time without a date
LocalDateTime
a combination of date and time
ZonedDateTime
LocalDateTime combines with the time zone provided using ZoneId class.
OffsetTime
Handles time with a corresponding time zone offset from Greenwich/UTC, without a time zone ID.
OffsetDateTime
Handles a date and time with a corresponding time zone offset from Greenwich/UTC, without a time zone ID.
Clock
Provides access to the current instant, date, and time in any given time zone.
Instant
represents the start of a nanosecond on the timeline and useful for generating a timestamp to represent machine time
Duration
Difference between two instants and measured in seconds or nanoseconds and does not use date-based constructs such as years, months, and days, though the class provides methods that convert to days, hours, and minutes.
Period
To define the difference between dates in date-based values (years, months, days).
ZoneId
specifies a time zone identifier and provides rules for converting between an Instant and a LocalDateTime.
ZoneOffset
Specifies a time zone offset from Greenwich/UTC.