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);
}
}
Output
SystemClock[Australia/Sydney]