OffsetTime.now

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

@param zone the zone ID to use, not null @return the current time using the system clock, not null

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

Meta