获取世界各地区的时间
package com.zhiming.tree;import java.text.SimpleDateFormat;import java.util.Calendar;import java.util.Date;import java.util.GregorianCalendar;import java.util.TimeZone;public class CountryDate{/** * @author ZhangXiLiang * @param args */public static void main(String[] args) throws Exception{Calendar c2;SimpleDateFormat sdf = new SimpleDateFormat("yyyy年-MM月-dd日' 'HH:mm:ss");// Calendar c = Calendar.getInstance();// 日历对象设置当前时间为系统时间// c.setTimeInMillis(System.currentTimeMillis());// Calendar日期类型转换为Date// Date nowtime = c.getTime();for (String str : TimeZone.getAvailableIDs()){String newStr = null;int number = str.lastIndexOf("/");if (number != -1){newStr = str.substring(number + 1);}else{newStr = str;}if (!newStr.contains("GMT")){TimeZone timezone = TimeZone.getTimeZone(newStr);c2 = new GregorianCalendar(timezone);System.out.println("时区的ID:" + newStr + " 当前的小时:"+ c2.get(Calendar.HOUR_OF_DAY)+" ");}}// System.out.println(sdf.format(nowtime));}}