Get current TimeZone using Calendar - Java Date Time

Java examples for Date Time:Calendar

Description

Get current TimeZone using Calendar

Demo Code

 
import java.util.Calendar;
import java.util.TimeZone;
 
public class Main {
 
  public static void main(String[] args) {
   /*from ww w  .  j  av a  2 s . c  o m*/
    Calendar now = Calendar.getInstance();
   
    TimeZone timeZone = now.getTimeZone();
   
    System.out.println("Current TimeZone is : " + timeZone.getDisplayName());
  }
}

Result


Related Tutorials