Question

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?

Was it helpful?

Solution

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());

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top