Java Date Time Java Java API
java.time.Clock
public static Clock system(ZoneId zone)
Creates a clock that returns the current instant using best available system clock. The clock uses the specified time-zone.
package com.logicbig.example.clock;import java.time.Clock;import java.time.ZoneId;public class SystemExample { public static void main(String... args) { Clock c = Clock.system(ZoneId.of("Australia/Sydney")); System.out.println(c); }}
SystemClock[Australia/Sydney]