Get timezone id

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