Java java.time OffsetDateTime fields, constructors, methods, implement or subclass

Example usage for Java java.time OffsetDateTime fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.time OffsetDateTime.

The text is from its open source code.

Field

OffsetDateTimeMIN
The minimum supported OffsetDateTime , '-999999999-01-01T00:00:00+18:00'.
OffsetDateTimeMAX
The maximum supported OffsetDateTime , '+999999999-12-31T23:59:59.999999999-18:00'.

Method

TemporaladjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same offset, date and time as this object.
ZonedDateTimeatZoneSameInstant(ZoneId zone)
Combines this date-time with a time-zone to create a ZonedDateTime ensuring that the result has the same instant.
ZonedDateTimeatZoneSimilarLocal(ZoneId zone)
Combines this date-time with a time-zone to create a ZonedDateTime trying to keep the same local date and time.
intcompareTo(OffsetDateTime other)
Compares this date-time to another date-time.
booleanequals(Object obj)
Checks if this date-time is equal to another date-time.
Stringformat(DateTimeFormatter formatter)
Formats this date-time using the specified formatter.
OffsetDateTimefrom(TemporalAccessor temporal)
Obtains an instance of OffsetDateTime from a temporal object.
intget(TemporalField field)
Gets the value of the specified field from this date-time as an int .
intgetDayOfMonth()
Gets the day-of-month field.
DayOfWeekgetDayOfWeek()
Gets the day-of-week field, which is an enum DayOfWeek .
intgetDayOfYear()
Gets the day-of-year field.
intgetHour()
Gets the hour-of-day field.
longgetLong(TemporalField field)
Gets the value of the specified field from this date-time as a long .
intgetMinute()
Gets the minute-of-hour field.
MonthgetMonth()
Gets the month-of-year field using the Month enum.
intgetNano()
Gets the nano-of-second field.
ZoneOffsetgetOffset()
Gets the zone offset, such as '+01:00'.
intgetSecond()
Gets the second-of-minute field.
intgetYear()
Gets the year field.
inthashCode()
A hash code for this date-time.
booleanisAfter(OffsetDateTime other)
Checks if the instant of this date-time is after that of the specified date-time.
booleanisBefore(OffsetDateTime other)
Checks if the instant of this date-time is before that of the specified date-time.
booleanisEqual(OffsetDateTime other)
Checks if the instant of this date-time is equal to that of the specified date-time.
booleanisSupported(TemporalField field)
Checks if the specified field is supported.
booleanisSupported(TemporalUnit unit)
Checks if the specified unit is supported.
OffsetDateTimeminus(long amountToSubtract, TemporalUnit unit)
Returns a copy of this date-time with the specified amount subtracted.
OffsetDateTimeminus(TemporalAmount amountToSubtract)
Returns a copy of this date-time with the specified amount subtracted.
OffsetDateTimeminusDays(long days)
Returns a copy of this OffsetDateTime with the specified number of days subtracted.
OffsetDateTimeminusHours(long hours)
Returns a copy of this OffsetDateTime with the specified number of hours subtracted.
OffsetDateTimeminusMinutes(long minutes)
Returns a copy of this OffsetDateTime with the specified number of minutes subtracted.
OffsetDateTimeminusMonths(long months)
Returns a copy of this OffsetDateTime with the specified number of months subtracted.
OffsetDateTimeminusNanos(long nanos)
Returns a copy of this OffsetDateTime with the specified number of nanoseconds subtracted.
OffsetDateTimeminusSeconds(long seconds)
Returns a copy of this OffsetDateTime with the specified number of seconds subtracted.
OffsetDateTimeminusWeeks(long weeks)
Returns a copy of this OffsetDateTime with the specified number of weeks subtracted.
OffsetDateTimeminusYears(long years)
Returns a copy of this OffsetDateTime with the specified number of years subtracted.
OffsetDateTimenow()
Obtains the current date-time from the system clock in the default time-zone.
OffsetDateTimenow(ZoneId zone)
Obtains the current date-time from the system clock in the specified time-zone.
OffsetDateTimenow(Clock clock)
Obtains the current date-time from the specified clock.
OffsetDateTimeof(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.
OffsetDateTimeof(LocalDateTime dateTime, ZoneOffset offset)
Obtains an instance of OffsetDateTime from a date-time and offset.
OffsetDateTimeof(LocalDate date, LocalTime time, ZoneOffset offset)
Obtains an instance of OffsetDateTime from a date, time and offset.
OffsetDateTimeofInstant(Instant instant, ZoneId zone)
Obtains an instance of OffsetDateTime from an Instant and zone ID.
OffsetDateTimeparse(CharSequence text)
Obtains an instance of OffsetDateTime from a text string such as 2007-12-03T10:15:30+01:00 .
OffsetDateTimeparse(CharSequence text, DateTimeFormatter formatter)
Obtains an instance of OffsetDateTime from a text string using a specific formatter.
OffsetDateTimeplus(long amountToAdd, TemporalUnit unit)
Returns a copy of this date-time with the specified amount added.
OffsetDateTimeplus(TemporalAmount amountToAdd)
Returns a copy of this date-time with the specified amount added.
OffsetDateTimeplusDays(long days)
Returns a copy of this OffsetDateTime with the specified number of days added.
OffsetDateTimeplusHours(long hours)
Returns a copy of this OffsetDateTime with the specified number of hours added.
OffsetDateTimeplusMinutes(long minutes)
Returns a copy of this OffsetDateTime with the specified number of minutes added.
OffsetDateTimeplusMonths(long months)
Returns a copy of this OffsetDateTime with the specified number of months added.
OffsetDateTimeplusNanos(long nanos)
Returns a copy of this OffsetDateTime with the specified number of nanoseconds added.
OffsetDateTimeplusSeconds(long seconds)
Returns a copy of this OffsetDateTime with the specified number of seconds added.
OffsetDateTimeplusWeeks(long weeks)
Returns a copy of this OffsetDateTime with the specified number of weeks added.
OffsetDateTimeplusYears(long years)
Returns a copy of this OffsetDateTime with the specified number of years added.
Rquery(TemporalQuery query)
Queries this date-time using the specified query.
ValueRangerange(TemporalField field)
Gets the range of valid values for the specified field.
ComparatortimeLineOrder()
Gets a comparator that compares two OffsetDateTime instances based solely on the instant.
longtoEpochSecond()
Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.
InstanttoInstant()
Converts this date-time to an Instant .
LocalDatetoLocalDate()
Gets the LocalDate part of this date-time.
LocalDateTimetoLocalDateTime()
Gets the LocalDateTime part of this date-time.
LocalTimetoLocalTime()
Gets the LocalTime part of this date-time.
OffsetTimetoOffsetTime()
Converts this date-time to an OffsetTime .
StringtoString()
Outputs this date-time as a String , such as 2007-12-03T10:15:30+01:00 .
ZonedDateTimetoZonedDateTime()
Converts this date-time to a ZonedDateTime using the offset as the zone ID.
OffsetDateTimetruncatedTo(TemporalUnit unit)
Returns a copy of this OffsetDateTime with the time truncated.
longuntil(Temporal endExclusive, TemporalUnit unit)
Calculates the amount of time until another date-time in terms of the specified unit.
OffsetDateTimewith(TemporalAdjuster adjuster)
Returns an adjusted copy of this date-time.
OffsetDateTimewith(LocalDateTime dateTime, ZoneOffset offset)
Returns a new date-time based on this one, returning this where possible.
OffsetDateTimewith(TemporalField field, long newValue)
Returns a copy of this date-time with the specified field set to a new value.
OffsetDateTimewithDayOfMonth(int dayOfMonth)
Returns a copy of this OffsetDateTime with the day-of-month altered.
OffsetDateTimewithDayOfYear(int dayOfYear)
Returns a copy of this OffsetDateTime with the day-of-year altered.
OffsetDateTimewithHour(int hour)
Returns a copy of this OffsetDateTime with the hour-of-day altered.
OffsetDateTimewithMinute(int minute)
Returns a copy of this OffsetDateTime with the minute-of-hour altered.
OffsetDateTimewithMonth(int month)
Returns a copy of this OffsetDateTime with the month-of-year altered.
OffsetDateTimewithNano(int nanoOfSecond)
Returns a copy of this OffsetDateTime with the nano-of-second altered.
OffsetDateTimewithOffsetSameInstant(ZoneOffset offset)
Returns a copy of this OffsetDateTime with the specified offset ensuring that the result is at the same instant.
OffsetDateTimewithOffsetSameLocal(ZoneOffset offset)
Returns a copy of this OffsetDateTime with the specified offset ensuring that the result has the same local date-time.
OffsetDateTimewithSecond(int second)
Returns a copy of this OffsetDateTime with the second-of-minute altered.
OffsetDateTimewithYear(int year)
Returns a copy of this OffsetDateTime with the year altered.