Clock getZone() example
Description
Clock getZone()
gets the time-zone
used to create dates and times.
Syntax
getZone
has the following syntax.
public abstract ZoneId getZone()
Example
The following example shows how to use getZone
.
import java.time.Clock;
/*w w w. ja v a 2s . c om*/
public class Main {
public static void main(String[] args) {
Clock clock = Clock.systemDefaultZone();
System.out.println(clock.getZone());
}
}
The code above generates the following result.