OffsetDateTime.now

Obtains the current date-time from the system clock _in the default time-zone. !(p) This will query the {@link Clock#systemDefaultZone() system clock} _in the default time-zone to obtain the current date-time. The offset will be calculated from the time-zone _in the clock. !(p) Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.

@return the current date-time using the system clock, not null

  1. OffsetDateTime now()
    class OffsetDateTime
    static
    now
    ()
  2. OffsetDateTime now(ZoneId zone)
  3. OffsetDateTime now(Clock clock)

Meta