Java Reference
In-Depth Information
Class Name
Description
Specifies zone identifier and is used for conversions.
ZoneId
ZoneOffset
Specifies a time zone offset from Greenwich/UTC time.
A date-time object that also handles the time zone data
with time zone offset from Greenwich/UTC time.
ZonedDateTime
Rules defining how a zone offset varies for a specified
time zone.
ZoneRules
Provider of time zone rules to a particular system.
ZoneRulesProvider
Transition between two offsets by a discontinuity in the
local timeline.
ZoneOffsetTransition
Rules expressing how to create a transition.
ZoneOffsetTransitionRule
Starting with the most fundamental time zone class,
ZoneId
, each time zone con-
tains a particular time zone identifier. This identifier can be useful for assigning a par-
ticular time zone to a date-time. In the solution, the
ZoneId
is used to calculate any
differences between two time zones.
ZoneId
identifies the rules that should be used
for converting, based on a particular offset, either fixed or geographical region-based.
ZonedDateTime
is an immutable class that is utilized for working with date-
time and time zone data together. This class represents an object, much like
LocalDateTime
, that includes the
ZoneId
. It can be used to express all facets of a
date, including year, month, day, hours, minutes, seconds, nanos, and time zone. The
class contains a bevy of methods that are useful for performing calculations, conver-
sions, and so on.. For brevity, the methods that are contained in
ZonedDateTime
are
not listed here, but you can read about each of them in the documentation at
ht-
ZoneOffset
specifies a time zone offset from Greenwich/UTC time. You can
find the offset for a particular time zone by invoking the
ZonedDateTime.getOffset()
method. The
ZoneOffset
class includes meth-
ods that make it easy to break down an offset into different time units. For instance, the
getTotalSeconds()
method returns the total of hours, minutes, and seconds fields
as a single offset that can be added to a time. Refer to the online documentation for