Close

Java Date Time - Clock.systemDefaultZone() Examples

Java Date Time Java Java API 


Class:

java.time.Clock

java.lang.Objectjava.lang.Objectjava.time.Clockjava.time.ClockLogicBig

Method:

public static Clock systemDefaultZone()

Creates a clock that returns the current instant using the best available system clock, converting to the default time-zone.


Examples


package com.logicbig.example.clock;

import java.time.Clock;

public class SystemDefaultZoneExample {

public static void main(String... args) {
Clock c = Clock.systemDefaultZone();
System.out.println(c);
}
}

Output

SystemClock[America/Chicago]




See Also