ZonedDateTime.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 zone and offset will be set based on 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. ZonedDateTime now()
    class ZonedDateTime
    static
    now
    ()
  2. ZonedDateTime now(ZoneId zone)
  3. ZonedDateTime now(Clock clock)

Meta