Get timezone id

String getID()
Gets the ID of this time zone.

import java.util.TimeZone;

public class Main {

  public static void main(String[] args) {
    TimeZone tz = TimeZone.getTimeZone("America/New_York");

    System.out.println(tz.getID());
  }
}

The output:


America/New_York
Home 
  Java Book 
    Essential Classes  

TimeZone:
  1. TimeZone class
  2. Create TimeZone
  3. Get availablve timezone ids
  4. Get display name for a timezone
  5. Get daylight saving
  6. Get timezone id