Here you can find the source of timeZoneToCode(TimeZone tz)
public static String timeZoneToCode(TimeZone tz)
//package com.java2s; //License from project: Apache License import java.util.TimeZone; public class Main { public static String timeZoneToCode(TimeZone tz) { return timeZoneToString(tz); }//from ww w.j a v a2s.c o m public static String timeZoneToString(TimeZone tz) { return tz != null ? tz.getID() : ""; } }