public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Calendar calendar = Calendar.getInstance();
sdf.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
System.out.println("Los_Angeles :"+sdf.format(calendar.getTime()));
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
System.out.println("Shanghai: "+sdf.format(calendar.getTime()));
}
不同时区的时间问题
如未加特殊说明,此网站文章均为原创,转载必须注明出处。HollisChuang's Blog » 不同时区的时间问题