Java Date Time Java Java API
java.time.Clock
public abstract Clock withZone(ZoneId zone)
Returns a copy of this clock with the specified time-zone.
package com.logicbig.example.clock;import java.time.Clock;import java.time.ZoneId;public class WithZoneExample { public static void main(String... args) { Clock c = Clock.systemDefaultZone(); System.out.println(c); Clock c2 = c.withZone(ZoneId.of("Asia/Seoul")); System.out.println(c2); }}
SystemClock[America/Chicago]SystemClock[Asia/Seoul]