Here you can find the source of getFilteredTimeZoneMap()
public static Map<String, String> getFilteredTimeZoneMap()
//package com.java2s; //License from project: Apache License import java.util.LinkedHashMap; import java.util.Map; import java.util.TimeZone; public class Main { private static final int CONSTANT_60 = 60; private static final int CONSTANT_1000 = 1000; private static Map<String, String> timezoneIDMap; /**//from www .j a va2 s . c o m * Get time zones. * * @return map typezone id and GMT */ public static Map<String, String> getFilteredTimeZoneMap() { if (timezoneIDMap == null) { timezoneIDMap = new LinkedHashMap<String, String>(); String[] ids = TimeZone.getAvailableIDs(); for (String id : ids) { TimeZone zone = TimeZone.getTimeZone(id); int offset = zone.getRawOffset(); int offsetSecond = offset / CONSTANT_1000; int hour = offsetSecond / (CONSTANT_60 * CONSTANT_60); int minutes = (offsetSecond % (CONSTANT_60 * CONSTANT_60)) / CONSTANT_60; timezoneIDMap.put(TimeZone.getTimeZone(id).getDisplayName(), String.format("(GMT%+d:%02d) %s", hour, minutes, id)); } } return timezoneIDMap; } }