在java1.5中怎么生成这样的时区列表啊?急急急....在线等
怎么生成这样的时区列表啊?用java1.5
<html:option value= "MIT "> [GMT -11:00] Samoa Standard Time </html:option>
<html:option value= "HST "> [GMT -10:00] Hawaiian Standard Time </html:option>
<html:option value= "AST "> [GMT -09:00] Alaskan Standard Time </html:option>
<html:option value= "PST "> [GMT -08:00] Pacific Standard Time </html:option>
<html:option value= "PNT "> [GMT -07:00] Arizona Standard Time </html:option>
<html:option value= "MST "> [GMT -07:00] Mountain Standard Time </html:option>
<html:option value= "CST "> [GMT -06:00] Central Standard Time </html:option>
<html:option value= "IET "> [GMT -05:00] Indiana Eastern Standard </html:option>
<html:option value= "EST "> [GMT -05:00] Eastern Standard Time </html:option>
<html:option value= "PRT "> [GMT -04:00] Atlantic Standard Time </html:option>
<html:option value= "AGT "> [GMT -03:00] Argentina Standard Time </html:option>
<html:option value= "BET "> [GMT -03:00] Brazil Eastern Time </html:option>
<html:option value= "CNT "> [GMT -03:30] Newfoundland Standard Time </html:option>
<html:option value= "CAT "> GMT -01:00] Central African Time </html:option>
<html:option value= "GMT "> [GMT 00:00] Greenwich Mean Time </html:option>
<html:option value= "ECT "> [GMT +01:00] European Central Time </html:option>
<html:option value= "EET "> [GMT +03:00] Eastern European Time </html:option>
<html:option value= "ART "> [GMT +02:00] Egypt Standard Time </html:option>
<html:option value= "EAT "> [GMT +03:00] Eastern African Time </html:option>
<html:option value= "NET "> [GMT +04:00] Arabian Standard Time </html:option>
<html:option value= "MET "> [GMT +03:30] Iran Standard Time </html:option>
<html:option value= "PLT "> [GMT +05:00] West Asia Standard Time </html:option>
<html:option value= "IST "> [GMT +05:30] India Standard Time </html:option>
<html:option value= "BST "> [GMT +06:00] Central Asia Standard Time </html:option>
<html:option value= "VST "> [GMT +07:00] SE Asia Standard Time </html:option>
<html:option value= "CTT "> [GMT +08:00] China Standard Time </html:option>
<html:option value= "JST "> [GMT +09:00] Tokyo Standard Time </html:option>
<html:option value= "ACT "> [GMT +09:30] Australia Central Time </html:option>
<html:option value= "AET "> [GMT +10:00] AUS Eastern Standard Time </html:option>
<html:option value= "SST "> [GMT +11:00] Central Pacific Standard Time </html:option>
<html:option value= "NST "> [GMT +12:00] New Zealand Standard Time </html:option>
[解决办法]
public static void main(String args[]){
String timezoneIds[]=TimeZone.getAvailableIDs();
Date date=new Date();
SimpleDateFormat format=new SimpleDateFormat( "z yyyy-MM-dd HH:mm:ss ");
for(int i=0;i <timezoneIds.length;i++){
TimeZone tz=TimeZone.getTimeZone(timezoneIds[i]);
format.setTimeZone(tz);
System.out.println(tz.getID() + " , "+ format.format(date));
}
}
[解决办法]
自己看TimeZone类啊