Uses of Class
java.time.OffsetDateTime
Packages that use OffsetDateTime
-
Uses of OffsetDateTime in java.time
Fields in java.time declared as OffsetDateTimeModifier and TypeFieldDescriptionstatic final OffsetDateTime
OffsetDateTime.MAX
The maximum supportedOffsetDateTime
, '+999999999-12-31T23:59:59.999999999-18:00'.static final OffsetDateTime
OffsetDateTime.MIN
The minimum supportedOffsetDateTime
, '-999999999-01-01T00:00:00+18:00'.Methods in java.time that return OffsetDateTimeModifier and TypeMethodDescriptionCombines this time with a date to create anOffsetDateTime
.Instant.atOffset
(ZoneOffset offset) Combines this instant with an offset to create anOffsetDateTime
.LocalDateTime.atOffset
(ZoneOffset offset) Combines this date-time with an offset to create anOffsetDateTime
.LocalDate.atTime
(OffsetTime time) Combines this date with an offset time to create anOffsetDateTime
.static OffsetDateTime
OffsetDateTime.from
(TemporalAccessor temporal) Obtains an instance ofOffsetDateTime
from a temporal object.OffsetDateTime.minus
(long amountToSubtract, TemporalUnit unit) Returns a copy of this date-time with the specified amount subtracted.OffsetDateTime.minus
(TemporalAmount amountToSubtract) Returns a copy of this date-time with the specified amount subtracted.OffsetDateTime.minusDays
(long days) Returns a copy of thisOffsetDateTime
with the specified number of days subtracted.OffsetDateTime.minusHours
(long hours) Returns a copy of thisOffsetDateTime
with the specified number of hours subtracted.OffsetDateTime.minusMinutes
(long minutes) Returns a copy of thisOffsetDateTime
with the specified number of minutes subtracted.OffsetDateTime.minusMonths
(long months) Returns a copy of thisOffsetDateTime
with the specified number of months subtracted.OffsetDateTime.minusNanos
(long nanos) Returns a copy of thisOffsetDateTime
with the specified number of nanoseconds subtracted.OffsetDateTime.minusSeconds
(long seconds) Returns a copy of thisOffsetDateTime
with the specified number of seconds subtracted.OffsetDateTime.minusWeeks
(long weeks) Returns a copy of thisOffsetDateTime
with the specified number of weeks subtracted.OffsetDateTime.minusYears
(long years) Returns a copy of thisOffsetDateTime
with the specified number of years subtracted.static OffsetDateTime
OffsetDateTime.now()
Obtains the current date-time from the system clock in the default time-zone.static OffsetDateTime
Obtains the current date-time from the specified clock.static OffsetDateTime
Obtains the current date-time from the system clock in the specified time-zone.static OffsetDateTime
OffsetDateTime.of
(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset) Obtains an instance ofOffsetDateTime
from a year, month, day, hour, minute, second, nanosecond and offset.static OffsetDateTime
OffsetDateTime.of
(LocalDate date, LocalTime time, ZoneOffset offset) Obtains an instance ofOffsetDateTime
from a date, time and offset.static OffsetDateTime
OffsetDateTime.of
(LocalDateTime dateTime, ZoneOffset offset) Obtains an instance ofOffsetDateTime
from a date-time and offset.static OffsetDateTime
Obtains an instance ofOffsetDateTime
from anInstant
and zone ID.static OffsetDateTime
OffsetDateTime.parse
(CharSequence text) Obtains an instance ofOffsetDateTime
from a text string such as2007-12-03T10:15:30+01:00
.static OffsetDateTime
OffsetDateTime.parse
(CharSequence text, DateTimeFormatter formatter) Obtains an instance ofOffsetDateTime
from a text string using a specific formatter.OffsetDateTime.plus
(long amountToAdd, TemporalUnit unit) Returns a copy of this date-time with the specified amount added.OffsetDateTime.plus
(TemporalAmount amountToAdd) Returns a copy of this date-time with the specified amount added.OffsetDateTime.plusDays
(long days) Returns a copy of this OffsetDateTime with the specified number of days added.OffsetDateTime.plusHours
(long hours) Returns a copy of thisOffsetDateTime
with the specified number of hours added.OffsetDateTime.plusMinutes
(long minutes) Returns a copy of thisOffsetDateTime
with the specified number of minutes added.OffsetDateTime.plusMonths
(long months) Returns a copy of thisOffsetDateTime
with the specified number of months added.OffsetDateTime.plusNanos
(long nanos) Returns a copy of thisOffsetDateTime
with the specified number of nanoseconds added.OffsetDateTime.plusSeconds
(long seconds) Returns a copy of thisOffsetDateTime
with the specified number of seconds added.OffsetDateTime.plusWeeks
(long weeks) Returns a copy of this OffsetDateTime with the specified number of weeks added.OffsetDateTime.plusYears
(long years) Returns a copy of thisOffsetDateTime
with the specified number of years added.ZonedDateTime.toOffsetDateTime()
Converts this date-time to anOffsetDateTime
.OffsetDateTime.truncatedTo
(TemporalUnit unit) Returns a copy of thisOffsetDateTime
with the time truncated.OffsetDateTime.with
(TemporalAdjuster adjuster) Returns an adjusted copy of this date-time.OffsetDateTime.with
(TemporalField field, long newValue) Returns a copy of this date-time with the specified field set to a new value.OffsetDateTime.withDayOfMonth
(int dayOfMonth) Returns a copy of thisOffsetDateTime
with the day-of-month altered.OffsetDateTime.withDayOfYear
(int dayOfYear) Returns a copy of thisOffsetDateTime
with the day-of-year altered.OffsetDateTime.withHour
(int hour) Returns a copy of thisOffsetDateTime
with the hour-of-day altered.OffsetDateTime.withMinute
(int minute) Returns a copy of thisOffsetDateTime
with the minute-of-hour altered.OffsetDateTime.withMonth
(int month) Returns a copy of thisOffsetDateTime
with the month-of-year altered.OffsetDateTime.withNano
(int nanoOfSecond) Returns a copy of thisOffsetDateTime
with the nano-of-second altered.OffsetDateTime.withOffsetSameInstant
(ZoneOffset offset) Returns a copy of thisOffsetDateTime
with the specified offset ensuring that the result is at the same instant.OffsetDateTime.withOffsetSameLocal
(ZoneOffset offset) Returns a copy of thisOffsetDateTime
with the specified offset ensuring that the result has the same local date-time.OffsetDateTime.withSecond
(int second) Returns a copy of thisOffsetDateTime
with the second-of-minute altered.OffsetDateTime.withYear
(int year) Returns a copy of thisOffsetDateTime
with the year altered.Methods in java.time that return types with arguments of type OffsetDateTimeModifier and TypeMethodDescriptionstatic Comparator<OffsetDateTime>
OffsetDateTime.timeLineOrder()
Gets a comparator that compares twoOffsetDateTime
instances based solely on the instant.Methods in java.time with parameters of type OffsetDateTimeModifier and TypeMethodDescriptionint
OffsetDateTime.compareTo
(OffsetDateTime other) Compares this date-time to another date-time.boolean
OffsetDateTime.isAfter
(OffsetDateTime other) Checks if the instant of this date-time is after that of the specified date-time.boolean
OffsetDateTime.isBefore
(OffsetDateTime other) Checks if the instant of this date-time is before that of the specified date-time.boolean
OffsetDateTime.isEqual
(OffsetDateTime other) Checks if the instant of this date-time is equal to that of the specified date-time.