Lesson: Standard Calendar
The core of the Date-Time API is the java.time package. The classes defined in
java\.time base their calendar system on the ISO calendar, which is the world standard for representing date and time. The ISO calendar follows the proleptic Gregorian rules. The Gregorian calendar was introduced in 1582; in the proleptic Gregorian calendar, dates are extended backwards from that time to create a consistent, unified timeline and to simplify date calculations.
This lesson covers the following topics:
This section compares the concepts of human time and machine time provides a table of the primary temporal-based classes in the
This section discusses the enum that defines the days of the week (
DayOfWeek ) and the enum that defines months (
This section shows the temporal-based classes that deal only with dates, without time or time zones. The four classes are
This section presents the
LocalDateTime classes, which deal with time, and date and time, respectively, but without time zones.
This section discusses the temporal-based classes that store time zone (or time zone offset) information,
OffsetDateTime , and
OffsetTime . The supporting classes,
ZoneRules , and
ZoneOffset , are also discussed.
This section discusses the
Instant class, which represents an instantaneous moment on the timeline.
This section provides an overview of how to use the predefined formatters to format and parse date and time values.
This section presents an overview of the
java\.time\.temporal package, which supports the temporal classes, fields (
ChronoField ) and units (
ChronoUnit ). This section also explains how to use a temporal adjuster to retrieve an adjusted time value, such as "the first Tuesday after April 11", and how to perform a temporal query.
This section explains how to calculate an amount of time, using both the
Duration classes, as well as the
This section provides a brief overview of the
Clock class. You can use this class to provide an alternative clock to the system clock.
This section explains how to convert from a date in the ISO calendar system to a date in a non-ISO calendar system, such as a
JapaneseDate or a
This section offers some tips on how to convert older
java\.util\.Calendar code to the Date-Time API.
This section provides a summary of the Standard Calendar lesson.