문제

Calendar gives the different values with the same data. That is,

calT.setTimeZone(_.calc.ap.getTZ());
calT.setTimeInMillis(_.calc.ap.getCalMainTime());

calT.setTimeZone(timezonebase);
calT.setTimeInMillis(curData.getTimeBase());

In different part of code gives the different values.

_.calc.ap.getTZ() and timezonebase are the same and they are equal to "Europe/Moscow" Time in millis for _.calc.ap.getCalMainTime() and curData.getTimeBase() is the same and equals to 568026000000L (1 Jan 1988 12:00 GMT+03:00)

The result are different by one hour: (1 Jan 1988 12:00 GMT+03:00) or (1 Jan 1988 13:00 GMT+03:00

I think this bug coursed by Russia removed DST two years ago. But how fix this bug?

도움이 되었습니까?

해결책

I found one ugly solution. May be somebody found better. Reinitialize the calendar.

calT = Calendar.getInstance();

calT.setTimeZone(.calc.ap.getTZ()); calT.setTimeInMillis(.calc.ap.getCalMainTime());

calT = Calendar.getInstance();

calT.setTimeZone(timezonebase); calT.setTimeInMillis(curData.getTimeBase());

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top