OffsetTime (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Serializable, Comparable<OffsetTime>, Temporal, TemporalAccessor, TemporalAdjuster
-
Field Summary
Fields
The maximum supported
OffsetTime, '23:59:59.999999999-18:00'.The minimum supported
OffsetTime, '00:00:00+18:00'. -
Method Summary
Adjusts the specified temporal object to have the same offset and time as this object.
Combines this time with a date to create an
OffsetDateTime.intCompares this
OffsetTimeto another time.booleanChecks if this time is equal to another time.
Formats this time using the specified formatter.
Obtains an instance of
OffsetTimefrom a temporal object.intGets the value of the specified field from this time as an
int.intgetHour()Gets the hour-of-day field.
longGets the value of the specified field from this time as a
long.intGets the minute-of-hour field.
intgetNano()Gets the nano-of-second field.
Gets the zone offset, such as '+01:00'.
intGets the second-of-minute field.
inthashCode()A hash code for this time.
booleanChecks if the instant of this
OffsetTimeis after that of the specified time applying both times to a common date.booleanChecks if the instant of this
OffsetTimeis before that of the specified time applying both times to a common date.booleanChecks if the instant of this
OffsetTimeis equal to that of the specified time applying both times to a common date.booleanChecks if the specified field is supported.
booleanChecks if the specified unit is supported.
Returns a copy of this time with the specified amount subtracted.
Returns a copy of this time with the specified amount subtracted.
minusHours(long hours) Returns a copy of this
OffsetTimewith the specified number of hours subtracted.minusMinutes(long minutes) Returns a copy of this
OffsetTimewith the specified number of minutes subtracted.minusNanos(long nanos) Returns a copy of this
OffsetTimewith the specified number of nanoseconds subtracted.minusSeconds(long seconds) Returns a copy of this
OffsetTimewith the specified number of seconds subtracted.now()Obtains the current time from the system clock in the default time-zone.
Obtains the current time from the specified clock.
Obtains the current time from the system clock in the specified time-zone.
of(int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset) Obtains an instance of
OffsetTimefrom an hour, minute, second and nanosecond.Obtains an instance of
OffsetTimefrom a local time and an offset.Obtains an instance of
OffsetTimefrom anInstantand zone ID.Obtains an instance of
OffsetTimefrom a text string such as10:15:30+01:00.Obtains an instance of
OffsetTimefrom a text string using a specific formatter.Returns a copy of this time with the specified amount added.
Returns a copy of this time with the specified amount added.
plusHours(long hours) Returns a copy of this
OffsetTimewith the specified number of hours added.plusMinutes(long minutes) Returns a copy of this
OffsetTimewith the specified number of minutes added.plusNanos(long nanos) Returns a copy of this
OffsetTimewith the specified number of nanoseconds added.plusSeconds(long seconds) Returns a copy of this
OffsetTimewith the specified number of seconds added.<R> RQueries this time using the specified query.
Gets the range of valid values for the specified field.
longConverts this
OffsetTimeto the number of seconds since the epoch of 1970-01-01T00:00:00Z.Gets the
LocalTimepart of this date-time.toString()Outputs this time as a
String, such as10:15:30+01:00.Returns a copy of this
OffsetTimewith the time truncated.longCalculates the amount of time until another time in terms of the specified unit.
Returns an adjusted copy of this time.
Returns a copy of this time with the specified field set to a new value.
withHour(int hour) Returns a copy of this
OffsetTimewith the hour-of-day altered.withMinute(int minute) Returns a copy of this
OffsetTimewith the minute-of-hour altered.withNano(int nanoOfSecond) Returns a copy of this
OffsetTimewith the nano-of-second altered.Returns a copy of this
OffsetTimewith the specified offset ensuring that the result is at the same instant on an implied day.Returns a copy of this
OffsetTimewith the specified offset ensuring that the result has the same local time.withSecond(int second) Returns a copy of this
OffsetTimewith the second-of-minute altered.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitCreates and returns a copy of this object.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
MIN
-
MAX
-
-
Method Details
-
now
-
now
-
now
-
of
-
of
-
ofInstant
-
from
-
parse
-
parse
-
isSupported
-
isSupported
-
range
-
get
-
getLong
-
getOffset
-
withOffsetSameLocal
-
withOffsetSameInstant
-
toLocalTime
-
getHour
-
getMinute
-
getSecond
-
getNano
-
with
-
with
-
withHour
-
withMinute
-
withSecond
-
withNano
-
truncatedTo
-
plus
-
plus
-
plusHours
-
plusMinutes
-
plusSeconds
-
plusNanos
-
minus
-
minus
-
minusHours
-
minusMinutes
-
minusSeconds
-
minusNanos
-
query
-
adjustInto
-
until
-
format
-
atDate
-
toEpochSecond
-
compareTo
-
isAfter
-
isBefore
-
isEqual
-
equals
-
hashCode
-
toString
-