Create TimeZone

static TimeZone getDefault()
Gets the default TimeZone for this host.
static TimeZone getTimeZone(String ID)
Gets the TimeZone for the given ID.

import java.util.Calendar;
import java.util.TimeZone;

public class Main {

  public static void main(String[] args) {
    Calendar calNewYork = Calendar.getInstance();

    calNewYork.setTimeZone(TimeZone.getTimeZone("America/New_York"));

    System.out.println("Time in New York: " + calNewYork.get(Calendar.HOUR_OF_DAY) + ":"
        + calNewYork.get(Calendar.MINUTE));

  }
}

The output:


Time in New York: 16:50
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