我有一個簡單的我的問題:如何獲得正確的時間(毫秒)與DST時區中的Java
TimeZone fromTimeZone = TimeZone.getTimeZone("America/Santiago");
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 8);
calendar.set(Calendar.MINUTE, 45);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
System.out.println(calendar.getTime() + " |Mili: " + calendar.getTimeInMillis());
輸出:(我的時區是ICT)
Wed Apr 01 19:45:00 ICT 2015 |Milisecond: 1427892300000
的問題是:日曆在DST日返回此時區的錯誤時間。目前「美國/聖地亞哥」時區應爲UTC-3(參考號:http://www.timeanddate.com/worldclock/chile/santiago)。它需要顯示:
Wed Apr 01 18:45:00 ICT 2015 |Milisecond: 1427888700000
任何人都可以幫助我嗎? – 2015-04-08 01:27:09