A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as 2007-12-03T10:15:30+01:00.

See java.time.OffsetDateTime for full documentation

Hierarchy

  • OffsetDateTime

Constructors

Methods

  • Adjusts the specified temporal object to have the same offset, date and time as this object.

    Parameters

    Returns Temporal

  • Combines this date-time with a time-zone to create a ZonedDateTime ensuring that the result has the same instant.

    Parameters

    Returns ZonedDateTime

  • Combines this date-time with a time-zone to create a ZonedDateTime trying to keep the same local date and time.

    Parameters

    Returns ZonedDateTime

  • Compares this date-time to another date-time.

    Parameters

    Returns number

  • Formats this date-time using the specified formatter.

    Parameters

    Returns string

  • Gets the value of the specified field from this date-time as an int.

    Parameters

    Returns number

  • Gets the day-of-month field. The first day of the month is 1.

    Returns number

  • Gets the day-of-week field, which is an enum DayOfWeek. Use the method getValue() to extract the numeric value of the day Remember that "Monday" has a getValue of 1, and "Sunday" a getValue of 7

    Returns DayOfWeek

  • Gets the day-of-year field. The minimum value of this is 1, and the max is 365 or 366 depending on if it is a leapyear

    Returns number

  • Gets the hour-of-day field.

    Returns number

  • Gets the value of the specified field from this date-time as a long.

    Parameters

    Returns number

  • Gets the minute-of-hour field.

    Returns number

  • Gets the month-of-year field using the Month enum.

    Returns Month

  • Gets the month-of-year field from 1 to 12.

    Returns number

  • Gets the nano-of-second field.

    Returns number

  • Gets the zone offset, such as '+01:00'.

    Returns ZoneOffset

  • Gets the second-of-minute field.

    Returns number

  • Gets the year field.

    Returns number

  • A hash code for this date-time.

    Returns number

  • Checks if the instant of this date-time is after that of the specified date-time.

    Parameters

    Returns boolean

  • Checks if the instant of this date-time is before that of the specified date-time.

    Parameters

    Returns boolean

  • Checks if the instant of this date-time is equal to that of the specified date-time.

    Parameters

    Returns boolean

  • Checks if the specified field is supported.

    Parameters

    Returns boolean

  • Checks if the specified unit is supported.

    Parameters

    Returns boolean

  • Returns a copy of this date-time with the specified amount subtracted.

    Parameters

    Returns OffsetDateTime

  • Returns a copy of this date-time with the specified amount subtracted.

    Parameters

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of days subtracted.

    Parameters

    • days: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of hours subtracted.

    Parameters

    • hours: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of minutes subtracted.

    Parameters

    • minutes: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of months subtracted.

    Parameters

    • months: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of nanoseconds subtracted.

    Parameters

    • nanos: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of seconds subtracted.

    Parameters

    • seconds: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of weeks subtracted.

    Parameters

    • weeks: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of years subtracted.

    Parameters

    • years: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of days added.

    Parameters

    • days: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of hours added.

    Parameters

    • hours: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of minutes added.

    Parameters

    • minutes: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of months added.

    Parameters

    • months: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of nanoseconds added.

    Parameters

    • nanos: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of seconds added.

    Parameters

    • seconds: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of weeks added.

    Parameters

    • weeks: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified number of years added.

    Parameters

    • years: number

    Returns OffsetDateTime

  • Queries this date-time using the specified query.

    Type Parameters

    • R

    Parameters

    Returns R

  • Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.

    Returns number

  • Converts this date-time to an Instant.

    Returns Instant

  • Gets the LocalDate part of this date-time.

    Returns LocalDate

  • Gets the LocalTime part of this date-time.

    Returns LocalTime

  • Converts this date-time to an OffsetTime.

    Returns OffsetTime

  • Converts this date-time to a ZonedDateTime using the offset as the zone ID.

    Returns ZonedDateTime

  • Calculates the amount of time until another date-time in terms of the specified unit.

    Parameters

    Returns number

  • Returns a copy of this OffsetDateTime with the day-of-month altered.

    Parameters

    • dayOfMonth: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the day-of-year altered.

    Parameters

    • dayOfYear: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the hour-of-day altered.

    Parameters

    • hour: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the minute-of-hour altered.

    Parameters

    • minute: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the month-of-year altered.

    Parameters

    • month: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the nano-of-second altered.

    Parameters

    • nanoOfSecond: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified offset ensuring that the result is at the same instant.

    Parameters

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the specified offset ensuring that the result has the same local date-time.

    Parameters

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the second-of-minute altered.

    Parameters

    • second: number

    Returns OffsetDateTime

  • Returns a copy of this OffsetDateTime with the year altered.

    Parameters

    • year: number

    Returns OffsetDateTime

  • Obtains the current date-time from the system clock in the default time-zone.

    Parameters

    • Optional clockOrZoneId: Clock | ZoneId

      Obtains the current date-time from the specified clock or the system clock in the specified time-zone.

    Returns OffsetDateTime

  • Obtains an instance of OffsetDateTime from a year, month, day, hour, minute, second, nanosecond and offset.

    Parameters

    • year: number
    • month: number
    • dayOfMonth: number
    • hour: number
    • minute: number
    • second: number
    • nanoOfSecond: number
    • offset: ZoneOffset

    Returns OffsetDateTime

  • Obtains an instance of OffsetDateTime from a date, time and offset.

    Parameters

    Returns OffsetDateTime

  • Obtains an instance of OffsetDateTime from a date-time and offset.

    Parameters

    Returns OffsetDateTime

  • Obtains an instance of OffsetDateTime from a text string such as 2007-12-03T10:15:30+01:00.

    Parameters

    Returns OffsetDateTime

  • Gets a function that compares two OffsetDateTime instances based solely on the instant.

    Returns ((o1, o2) => number)

      • (o1, o2): number
      • Gets a function that compares two OffsetDateTime instances based solely on the instant.

        Returns number

Generated using TypeDoc