Example usage for java.time Clock withZone

List of usage examples for java.time Clock withZone

Introduction

In this page you can find the example usage for java.time Clock withZone.

Prototype

public abstract Clock withZone(ZoneId zone);

Source Link

Document

Returns a copy of this clock with a different time-zone.

Usage

From source file:Main.java

public static void main(String[] args) {
    Clock clock = Clock.systemUTC();
    System.out.println(clock.getZone());
    clock.withZone(ZoneId.systemDefault());

    System.out.println(clock.getZone());
}