Example usage for Java java.time OffsetDateTime fields, constructors, methods, implement or subclass
The text is from its open source code.
OffsetDateTime | MIN The minimum supported OffsetDateTime , '-999999999-01-01T00:00:00+18:00'. |
OffsetDateTime | MAX The maximum supported OffsetDateTime , '+999999999-12-31T23:59:59.999999999-18:00'. |
Temporal | adjustInto(Temporal temporal) Adjusts the specified temporal object to have the same offset, date and time as this object. |
ZonedDateTime | atZoneSameInstant(ZoneId zone) Combines this date-time with a time-zone to create a ZonedDateTime ensuring that the result has the same instant. |
ZonedDateTime | atZoneSimilarLocal(ZoneId zone) Combines this date-time with a time-zone to create a ZonedDateTime trying to keep the same local date and time. |
int | compareTo(OffsetDateTime other) Compares this date-time to another date-time. |
boolean | equals(Object obj) Checks if this date-time is equal to another date-time. |
String | format(DateTimeFormatter formatter) Formats this date-time using the specified formatter. |
OffsetDateTime | from(TemporalAccessor temporal) Obtains an instance of OffsetDateTime from a temporal object. |
int | get(TemporalField field) Gets the value of the specified field from this date-time as an int . |
int | getDayOfMonth() Gets the day-of-month field. |
DayOfWeek | getDayOfWeek() Gets the day-of-week field, which is an enum DayOfWeek . |
int | getDayOfYear() Gets the day-of-year field. |
int | getHour() Gets the hour-of-day field. |
long | getLong(TemporalField field) Gets the value of the specified field from this date-time as a long . |
int | getMinute() Gets the minute-of-hour field. |
Month | getMonth() Gets the month-of-year field using the Month enum. |
int | getNano() Gets the nano-of-second field. |
ZoneOffset | getOffset() Gets the zone offset, such as '+01:00'. |
int | getSecond() Gets the second-of-minute field. |
int | getYear() Gets the year field. |
int | hashCode() A hash code for this date-time. |
boolean | isAfter(OffsetDateTime other) Checks if the instant of this date-time is after that of the specified date-time. |
boolean | isBefore(OffsetDateTime other) Checks if the instant of this date-time is before that of the specified date-time. |
boolean | isEqual(OffsetDateTime other) Checks if the instant of this date-time is equal to that of the specified date-time. |
boolean | isSupported(TemporalField field) Checks if the specified field is supported. |
boolean | isSupported(TemporalUnit unit) Checks if the specified unit is supported. |
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 this OffsetDateTime with the specified number of days subtracted. |
OffsetDateTime | minusHours(long hours) Returns a copy of this OffsetDateTime with the specified number of hours subtracted. |
OffsetDateTime | minusMinutes(long minutes) Returns a copy of this OffsetDateTime with the specified number of minutes subtracted. |
OffsetDateTime | minusMonths(long months) Returns a copy of this OffsetDateTime with the specified number of months subtracted. |
OffsetDateTime | minusNanos(long nanos) Returns a copy of this OffsetDateTime with the specified number of nanoseconds subtracted. |
OffsetDateTime | minusSeconds(long seconds) Returns a copy of this OffsetDateTime with the specified number of seconds subtracted. |
OffsetDateTime | minusWeeks(long weeks) Returns a copy of this OffsetDateTime with the specified number of weeks subtracted. |
OffsetDateTime | minusYears(long years) Returns a copy of this OffsetDateTime with the specified number of years subtracted. |
OffsetDateTime | now() Obtains the current date-time from the system clock in the default time-zone. |
OffsetDateTime | now(ZoneId zone) Obtains the current date-time from the system clock in the specified time-zone. |
OffsetDateTime | now(Clock clock) Obtains the current date-time from the specified clock. |
OffsetDateTime | of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset) Obtains an instance of OffsetDateTime from a year, month, day, hour, minute, second, nanosecond and offset. |
OffsetDateTime | of(LocalDateTime dateTime, ZoneOffset offset) Obtains an instance of OffsetDateTime from a date-time and offset. |
OffsetDateTime | of(LocalDate date, LocalTime time, ZoneOffset offset) Obtains an instance of OffsetDateTime from a date, time and offset. |
OffsetDateTime | ofInstant(Instant instant, ZoneId zone) Obtains an instance of OffsetDateTime from an Instant and zone ID. |
OffsetDateTime | parse(CharSequence text) Obtains an instance of OffsetDateTime from a text string such as 2007-12-03T10:15:30+01:00 . |
OffsetDateTime | parse(CharSequence text, DateTimeFormatter formatter) Obtains an instance of OffsetDateTime 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 this OffsetDateTime with the specified number of hours added. |
OffsetDateTime | plusMinutes(long minutes) Returns a copy of this OffsetDateTime with the specified number of minutes added. |
OffsetDateTime | plusMonths(long months) Returns a copy of this OffsetDateTime with the specified number of months added. |
OffsetDateTime | plusNanos(long nanos) Returns a copy of this OffsetDateTime with the specified number of nanoseconds added. |
OffsetDateTime | plusSeconds(long seconds) Returns a copy of this OffsetDateTime 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 this OffsetDateTime with the specified number of years added. |
R | query(TemporalQuery Queries this date-time using the specified query. |
ValueRange | range(TemporalField field) Gets the range of valid values for the specified field. |
Comparator | timeLineOrder() Gets a comparator that compares two OffsetDateTime instances based solely on the instant. |
long | toEpochSecond() Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z. |
Instant | toInstant() Converts this date-time to an Instant . |
LocalDate | toLocalDate() Gets the LocalDate part of this date-time. |
LocalDateTime | toLocalDateTime() Gets the LocalDateTime part of this date-time. |
LocalTime | toLocalTime() Gets the LocalTime part of this date-time. |
OffsetTime | toOffsetTime() Converts this date-time to an OffsetTime . |
String | toString() Outputs this date-time as a String , such as 2007-12-03T10:15:30+01:00 . |
ZonedDateTime | toZonedDateTime() Converts this date-time to a ZonedDateTime using the offset as the zone ID. |
OffsetDateTime | truncatedTo(TemporalUnit unit) Returns a copy of this OffsetDateTime with the time truncated. |
long | until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another date-time in terms of the specified unit. |
OffsetDateTime | with(TemporalAdjuster adjuster) Returns an adjusted copy of this date-time. |
OffsetDateTime | with(LocalDateTime dateTime, ZoneOffset offset) Returns a new date-time based on this one, returning this where possible. |
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 this OffsetDateTime with the day-of-month altered. |
OffsetDateTime | withDayOfYear(int dayOfYear) Returns a copy of this OffsetDateTime with the day-of-year altered. |
OffsetDateTime | withHour(int hour) Returns a copy of this OffsetDateTime with the hour-of-day altered. |
OffsetDateTime | withMinute(int minute) Returns a copy of this OffsetDateTime with the minute-of-hour altered. |
OffsetDateTime | withMonth(int month) Returns a copy of this OffsetDateTime with the month-of-year altered. |
OffsetDateTime | withNano(int nanoOfSecond) Returns a copy of this OffsetDateTime with the nano-of-second altered. |
OffsetDateTime | withOffsetSameInstant(ZoneOffset offset) Returns a copy of this OffsetDateTime with the specified offset ensuring that the result is at the same instant. |
OffsetDateTime | withOffsetSameLocal(ZoneOffset offset) Returns a copy of this OffsetDateTime with the specified offset ensuring that the result has the same local date-time. |
OffsetDateTime | withSecond(int second) Returns a copy of this OffsetDateTime with the second-of-minute altered. |
OffsetDateTime | withYear(int year) Returns a copy of this OffsetDateTime with the year altered. |