Uses of Class
java.time.OffsetTime
| Package | Description |
|---|---|
| java.time |
The main API for dates, times, instants, and durations.
|
-
Uses of OffsetTime in java.time
Fields in java.time declared as OffsetTime Modifier and Type Field Description static OffsetTimeOffsetTime. MAXThe maximum supportedOffsetTime, '23:59:59.999999999-18:00'.static OffsetTimeOffsetTime. MINThe minimum supportedOffsetTime, '00:00:00+18:00'.Methods in java.time that return OffsetTime Modifier and Type Method Description OffsetTimeLocalTime. atOffset(ZoneOffset offset)Combines this time with an offset to create anOffsetTime.static OffsetTimeOffsetTime. from(TemporalAccessor temporal)Obtains an instance ofOffsetTimefrom a temporal object.OffsetTimeOffsetTime. minus(long amountToSubtract, TemporalUnit unit)Returns a copy of this time with the specified amount subtracted.OffsetTimeOffsetTime. minus(TemporalAmount amountToSubtract)Returns a copy of this time with the specified amount subtracted.OffsetTimeOffsetTime. minusHours(long hours)Returns a copy of thisOffsetTimewith the specified number of hours subtracted.OffsetTimeOffsetTime. minusMinutes(long minutes)Returns a copy of thisOffsetTimewith the specified number of minutes subtracted.OffsetTimeOffsetTime. minusNanos(long nanos)Returns a copy of thisOffsetTimewith the specified number of nanoseconds subtracted.OffsetTimeOffsetTime. minusSeconds(long seconds)Returns a copy of thisOffsetTimewith the specified number of seconds subtracted.static OffsetTimeOffsetTime. now()Obtains the current time from the system clock in the default time-zone.static OffsetTimeOffsetTime. now(Clock clock)Obtains the current time from the specified clock.static OffsetTimeOffsetTime. now(ZoneId zone)Obtains the current time from the system clock in the specified time-zone.static OffsetTimeOffsetTime. of(int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset)Obtains an instance ofOffsetTimefrom an hour, minute, second and nanosecond.static OffsetTimeOffsetTime. of(LocalTime time, ZoneOffset offset)Obtains an instance ofOffsetTimefrom a local time and an offset.static OffsetTimeOffsetTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofOffsetTimefrom anInstantand zone ID.static OffsetTimeOffsetTime. parse(CharSequence text)Obtains an instance ofOffsetTimefrom a text string such as10:15:30+01:00.static OffsetTimeOffsetTime. parse(CharSequence text, DateTimeFormatter formatter)Obtains an instance ofOffsetTimefrom a text string using a specific formatter.OffsetTimeOffsetTime. plus(long amountToAdd, TemporalUnit unit)Returns a copy of this time with the specified amount added.OffsetTimeOffsetTime. plus(TemporalAmount amountToAdd)Returns a copy of this time with the specified amount added.OffsetTimeOffsetTime. plusHours(long hours)Returns a copy of thisOffsetTimewith the specified number of hours added.OffsetTimeOffsetTime. plusMinutes(long minutes)Returns a copy of thisOffsetTimewith the specified number of minutes added.OffsetTimeOffsetTime. plusNanos(long nanos)Returns a copy of thisOffsetTimewith the specified number of nanoseconds added.OffsetTimeOffsetTime. plusSeconds(long seconds)Returns a copy of thisOffsetTimewith the specified number of seconds added.OffsetTimeOffsetDateTime. toOffsetTime()Converts this date-time to anOffsetTime.OffsetTimeOffsetTime. truncatedTo(TemporalUnit unit)Returns a copy of thisOffsetTimewith the time truncated.OffsetTimeOffsetTime. with(TemporalAdjuster adjuster)Returns an adjusted copy of this time.OffsetTimeOffsetTime. with(TemporalField field, long newValue)Returns a copy of this time with the specified field set to a new value.OffsetTimeOffsetTime. withHour(int hour)Returns a copy of thisOffsetTimewith the hour-of-day altered.OffsetTimeOffsetTime. withMinute(int minute)Returns a copy of thisOffsetTimewith the minute-of-hour altered.OffsetTimeOffsetTime. withNano(int nanoOfSecond)Returns a copy of thisOffsetTimewith the nano-of-second altered.OffsetTimeOffsetTime. withOffsetSameInstant(ZoneOffset offset)Returns a copy of thisOffsetTimewith the specified offset ensuring that the result is at the same instant on an implied day.OffsetTimeOffsetTime. withOffsetSameLocal(ZoneOffset offset)Returns a copy of thisOffsetTimewith the specified offset ensuring that the result has the same local time.OffsetTimeOffsetTime. withSecond(int second)Returns a copy of thisOffsetTimewith the second-of-minute altered.Methods in java.time with parameters of type OffsetTime Modifier and Type Method Description OffsetDateTimeLocalDate. atTime(OffsetTime time)Combines this date with an offset time to create anOffsetDateTime.intOffsetTime. compareTo(OffsetTime other)Compares thisOffsetTimeto another time.booleanOffsetTime. isAfter(OffsetTime other)Checks if the instant of thisOffsetTimeis after that of the specified time applying both times to a common date.booleanOffsetTime. isBefore(OffsetTime other)Checks if the instant of thisOffsetTimeis before that of the specified time applying both times to a common date.booleanOffsetTime. isEqual(OffsetTime other)Checks if the instant of thisOffsetTimeis equal to that of the specified time applying both times to a common date.