Retrieving Information on All Available Time Zones
This example lists all time zones known by the JDK.
Here's a few time zone entries:
Date today = new Date();
// Get all time zone ids
String[] zoneIds = TimeZone.getAvailableIDs();
// View every time zone
for (int i=0; i<zoneIds.length; i++) {
// Get time zone by time zone id
TimeZone tz = TimeZone.getTimeZone(zoneIds[i]);
// Get the display name
String shortName = tz.getDisplayName(tz.inDaylightTime(today), TimeZone.SHORT);
String longName = tz.getDisplayName(tz.inDaylightTime(today), TimeZone.LONG);
// Get the number of hours from GMT
int rawOffset = tz.getRawOffset();
int hour = rawOffset / (60*60*1000);
int min = Math.abs(rawOffset / (60*1000)) % 60;
// Does the time zone have a daylight savings time period?
boolean hasDST = tz.useDaylightTime();
// Is the time zone currently in a daylight savings time?
boolean inDST = tz.inDaylightTime(today);
}
Id, Short Name, Long Name, Hour:Time from GMT ACT, CST, Central Standard Time (Northern Territory) 9:30 AET, EST, Eastern Summer Time (New South Wales) 10:0 AGT, ART, Argentine Time -3:0 ART, EET, Eastern European Time 2:0 AST, AKST, Alaska Standard Time -9:0 Africa/Abidjan, GMT, Greenwich Mean Time 0:0 Africa/Accra, GMT, Greenwich Mean Time 0:0 Africa/Addis_Ababa, EAT, Eastern African Time 3:0 Africa/Algiers, CET, Central European Time 1:0 Africa/Asmera, EAT, Eastern African Time 3:0 Africa/Bamako, GMT, Greenwich Mean Time 0:0 Africa/Bangui, WAT, Western African Time 1:0
Thanks,
It took me a while to find something like this...Though I do hope this list does not change in the (near or distant) future...
Hello i want to show london time then what exactly i do.
please reply
Your posts are always spot on ..