Reputation: 163
I have a simple for my problem:
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());
The output: (My timezone is ICT)
Wed Apr 01 19:45:00 ICT 2015 |Milisecond: 1427892300000
The problem is: The calendar return wrong time for this Timezone on DST day. The timezone "America/Santiago" should be UTC-3 for now (ref: http://www.timeanddate.com/worldclock/chile/santiago.) . It need to show:
Wed Apr 01 18:45:00 ICT 2015 |Milisecond: 1427888700000
Upvotes: 1
Views: 181