Create TimeZone

static TimeZonegetDefault()Gets the default TimeZone for this host.
static TimeZonegetTimeZone(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();


    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  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.