Java Clock create from ZoneId

Description

Java Clock create from ZoneId

import java.time.Clock;
import java.time.ZoneId;

public class Main {
  public static void main(String[] args) {
     ZoneId  zoneId = ZoneId.of("America/Los_Angeles");
     System.out.println(zoneId);//from  w w  w .ja  v a2s  .  c  o  m
     
     Clock clock = Clock.system(zoneId);
     System.out.println(clock);
  }

}



PreviousNext

Related