

LocalDateTime has five additional convenience variants of theĮquivalent factory method taking fewer arguments. Non test-code will typically use other methods to create an offset time. This method exists primarily for writing test cases. This creates an offset date-time with the seven specified fields. Hour, minute, second, nanosecond and offset.

Obtains an instance of OffsetDateTime from a year, month, day, Implementation Requirements: This class is immutable and thread-safe. The equals method should be used for comparisons. OffsetDateTime may have unpredictable results and should be avoided. ( =), identity hash code, or synchronization) on instances of More detail, or when communicating to a database or in a network protocol.Ĭlass use of identity-sensitive operations (including reference equality This class may be used when modeling date-time concepts in It is intended that ZonedDateTime or Instant is used to model data

OffsetDateTime adds to the instant the offset from UTC/Greenwich, which allows Instant is the simplest, simply representing the instant. On the time-line to nanosecond precision. OffsetDateTime, ZonedDateTime and Instant all store an instant "2nd October 2007 at 13:56789 +02:00" can be stored in an OffsetDateTime. This class stores all date and time fields, to a precision of nanoseconds,Īs well as the offset from UTC/Greenwich. OffsetDateTime is an immutable representation of a date-time with an offset. A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system,
