Here you can find the source of parseTimeZoneId(String timeZoneId)
public static TimeZone parseTimeZoneId(String timeZoneId)
//package com.java2s; //License from project: Apache License import java.util.TimeZone; public class Main { public static TimeZone parseTimeZoneId(String timeZoneId) { TimeZone zone = TimeZone.getDefault(); String zoneName = ""; if (null != timeZoneId && !"".equals(timeZoneId)) { timeZoneId = timeZoneId.trim().replaceAll("\\s+", ""); int index2 = timeZoneId.indexOf(")"); if (index2 >= 0) { zoneName = timeZoneId.substring(index2 + 1, timeZoneId.length()).trim(); }//from w ww .j a va2 s . c o m zone = TimeZone.getTimeZone(zoneName); } return zone; } }