Java Clock get clock from specified time zone

Description

Java Clock get clock from specified time zone

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

public class Main {
   public static void main(String[] args) {
      ZoneId asiaKolkata = ZoneId.of("Asia/Kolkata");
      Clock clock = Clock.system(asiaKolkata);

      System.out.println(clock);//from w  w w .  j a  v a 2 s  . c  o  m
   }
}



PreviousNext

Related