Uses of Class
java.time.OffsetDateTime
| Package | Description |
|---|---|
| java.time |
The main API for dates, times, instants, and durations.
|
-
Uses of OffsetDateTime in java.time
Fields in java.time declared as OffsetDateTime Modifier and Type Field Description static OffsetDateTimeOffsetDateTime. MAXThe maximum supportedOffsetDateTime, '+999999999-12-31T23:59:59.999999999-18:00'.static OffsetDateTimeOffsetDateTime. MINThe minimum supportedOffsetDateTime, '-999999999-01-01T00:00:00+18:00'.Methods in java.time that return OffsetDateTime Modifier and Type Method Description OffsetDateTimeOffsetTime. atDate(LocalDate date)Combines this time with a date to create anOffsetDateTime.OffsetDateTimeInstant. atOffset(ZoneOffset offset)Combines this instant with an offset to create anOffsetDateTime.OffsetDateTimeLocalDateTime. atOffset(ZoneOffset offset)Combines this date-time with an offset to create anOffsetDateTime.OffsetDateTimeLocalDate. atTime(OffsetTime time)Combines this date with an offset time to create anOffsetDateTime.static OffsetDateTimeOffsetDateTime. from(TemporalAccessor temporal)Obtains an instance ofOffsetDateTimefrom a temporal object.OffsetDateTimeOffsetDateTime. minus(long amountToSubtract, TemporalUnit unit)Returns a copy of this date-time with the specified amount subtracted.OffsetDateTimeOffsetDateTime. minus(TemporalAmount amountToSubtract)Returns a copy of this date-time with the specified amount subtracted.OffsetDateTimeOffsetDateTime. minusDays(long days)Returns a copy of thisOffsetDateTimewith the specified number of days subtracted.OffsetDateTimeOffsetDateTime. minusHours(long hours)Returns a copy of thisOffsetDateTimewith the specified number of hours subtracted.OffsetDateTimeOffsetDateTime. minusMinutes(long minutes)Returns a copy of thisOffsetDateTimewith the specified number of minutes subtracted.OffsetDateTimeOffsetDateTime. minusMonths(long months)Returns a copy of thisOffsetDateTimewith the specified number of months subtracted.OffsetDateTimeOffsetDateTime. minusNanos(long nanos)Returns a copy of thisOffsetDateTimewith the specified number of nanoseconds subtracted.OffsetDateTimeOffsetDateTime. minusSeconds(long seconds)Returns a copy of thisOffsetDateTimewith the specified number of seconds subtracted.OffsetDateTimeOffsetDateTime. minusWeeks(long weeks)Returns a copy of thisOffsetDateTimewith the specified number of weeks subtracted.OffsetDateTimeOffsetDateTime. minusYears(long years)Returns a copy of thisOffsetDateTimewith the specified number of years subtracted.static OffsetDateTimeOffsetDateTime. now()Obtains the current date-time from the system clock in the default time-zone.static OffsetDateTimeOffsetDateTime. now(Clock clock)Obtains the current date-time from the specified clock.static OffsetDateTimeOffsetDateTime. now(ZoneId zone)Obtains the current date-time from the system clock in the specified time-zone.static OffsetDateTimeOffsetDateTime. of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset)Obtains an instance ofOffsetDateTimefrom a year, month, day, hour, minute, second, nanosecond and offset.static OffsetDateTimeOffsetDateTime. of(LocalDate date, LocalTime time, ZoneOffset offset)Obtains an instance ofOffsetDateTimefrom a date, time and offset.static OffsetDateTimeOffsetDateTime. of(LocalDateTime dateTime, ZoneOffset offset)Obtains an instance ofOffsetDateTimefrom a date-time and offset.static OffsetDateTimeOffsetDateTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofOffsetDateTimefrom anInstantand zone ID.static OffsetDateTimeOffsetDateTime. parse(CharSequence text)Obtains an instance ofOffsetDateTimefrom a text string such as2007-12-03T10:15:30+01:00.static OffsetDateTimeOffsetDateTime. parse(CharSequence text, DateTimeFormatter formatter)Obtains an instance ofOffsetDateTimefrom a text string using a specific formatter.OffsetDateTimeOffsetDateTime. plus(long amountToAdd, TemporalUnit unit)Returns a copy of this date-time with the specified amount added.OffsetDateTimeOffsetDateTime. plus(TemporalAmount amountToAdd)Returns a copy of this date-time with the specified amount added.OffsetDateTimeOffsetDateTime. plusDays(long days)Returns a copy of this OffsetDateTime with the specified number of days added.OffsetDateTimeOffsetDateTime. plusHours(long hours)Returns a copy of thisOffsetDateTimewith the specified number of hours added.OffsetDateTimeOffsetDateTime. plusMinutes(long minutes)Returns a copy of thisOffsetDateTimewith the specified number of minutes added.OffsetDateTimeOffsetDateTime. plusMonths(long months)Returns a copy of thisOffsetDateTimewith the specified number of months added.OffsetDateTimeOffsetDateTime. plusNanos(long nanos)Returns a copy of thisOffsetDateTimewith the specified number of nanoseconds added.OffsetDateTimeOffsetDateTime. plusSeconds(long seconds)Returns a copy of thisOffsetDateTimewith the specified number of seconds added.OffsetDateTimeOffsetDateTime. plusWeeks(long weeks)Returns a copy of this OffsetDateTime with the specified number of weeks added.OffsetDateTimeOffsetDateTime. plusYears(long years)Returns a copy of thisOffsetDateTimewith the specified number of years added.OffsetDateTimeZonedDateTime. toOffsetDateTime()Converts this date-time to anOffsetDateTime.OffsetDateTimeOffsetDateTime. truncatedTo(TemporalUnit unit)Returns a copy of thisOffsetDateTimewith the time truncated.OffsetDateTimeOffsetDateTime. with(TemporalAdjuster adjuster)Returns an adjusted copy of this date-time.OffsetDateTimeOffsetDateTime. with(TemporalField field, long newValue)Returns a copy of this date-time with the specified field set to a new value.OffsetDateTimeOffsetDateTime. withDayOfMonth(int dayOfMonth)Returns a copy of thisOffsetDateTimewith the day-of-month altered.OffsetDateTimeOffsetDateTime. withDayOfYear(int dayOfYear)Returns a copy of thisOffsetDateTimewith the day-of-year altered.OffsetDateTimeOffsetDateTime. withHour(int hour)Returns a copy of thisOffsetDateTimewith the hour-of-day altered.OffsetDateTimeOffsetDateTime. withMinute(int minute)Returns a copy of thisOffsetDateTimewith the minute-of-hour altered.OffsetDateTimeOffsetDateTime. withMonth(int month)Returns a copy of thisOffsetDateTimewith the month-of-year altered.OffsetDateTimeOffsetDateTime. withNano(int nanoOfSecond)Returns a copy of thisOffsetDateTimewith the nano-of-second altered.OffsetDateTimeOffsetDateTime. withOffsetSameInstant(ZoneOffset offset)Returns a copy of thisOffsetDateTimewith the specified offset ensuring that the result is at the same instant.OffsetDateTimeOffsetDateTime. withOffsetSameLocal(ZoneOffset offset)Returns a copy of thisOffsetDateTimewith the specified offset ensuring that the result has the same local date-time.OffsetDateTimeOffsetDateTime. withSecond(int second)Returns a copy of thisOffsetDateTimewith the second-of-minute altered.OffsetDateTimeOffsetDateTime. withYear(int year)Returns a copy of thisOffsetDateTimewith the year altered.Methods in java.time that return types with arguments of type OffsetDateTime Modifier and Type Method Description static Comparator<OffsetDateTime>OffsetDateTime. timeLineOrder()Gets a comparator that compares twoOffsetDateTimeinstances based solely on the instant.Methods in java.time with parameters of type OffsetDateTime Modifier and Type Method Description intOffsetDateTime. compareTo(OffsetDateTime other)Compares this date-time to another date-time.booleanOffsetDateTime. isAfter(OffsetDateTime other)Checks if the instant of this date-time is after that of the specified date-time.booleanOffsetDateTime. isBefore(OffsetDateTime other)Checks if the instant of this date-time is before that of the specified date-time.booleanOffsetDateTime. isEqual(OffsetDateTime other)Checks if the instant of this date-time is equal to that of the specified date-time.