Module java.base
Package java.time

Class OffsetTime

java.lang.Object
java.time.OffsetTime
All Implemented Interfaces:
Serializable, Comparable<OffsetTime>, Temporal, TemporalAccessor, TemporalAdjuster

public final class OffsetTime extends Object implements Temporal, TemporalAdjuster, Comparable<OffsetTime>, Serializable
A time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as 10:15:30+01:00.

OffsetTime is an immutable date-time object that represents a time, often viewed as hour-minute-second-offset. This class stores all time fields, to a precision of nanoseconds, as well as a zone offset. For example, the value "13:45:30.123456789+02:00" can be stored in an OffsetTime.

This is a value-based class; programmers should treat instances that are equal as interchangeable and should not use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, synchronization may fail. The equals method should be used for comparisons.

Implementation Requirements:
This class is immutable and thread-safe.
Since:
1.8
See Also: