Java GregorianCalendar create from TimeZone

Description

Java GregorianCalendar create from TimeZone

import java.util.GregorianCalendar;
import java.util.TimeZone;

public class Main {
  public static void main(String[] args) {
     // Get Indian time zone, which is GMT+05:30
     TimeZone indianTZ = TimeZone.getTimeZone("GMT+05:30");
     GregorianCalendar indianDate = new GregorianCalendar(indianTZ);
     System.out.println(indianDate.getTime());
  }/*from w  ww .ja  va  2 s. c o  m*/

}



PreviousNext

Related