moment-timezone icon indicating copy to clipboard operation
moment-timezone copied to clipboard

Wrong timestamp for dates in transition period between GMT+0800 and GMT+0900 in Asia/Chita

Open dmitryshimkin opened this issue 9 years ago • 1 comments
trafficstars

First thank you guys for the great job you're doing.

I am using moment.timezone v0.5.5 with 2016f tzdata.

The test case is:

var m1 = moment.tz([2016, 2, 27, 1, 59, 59, 0], 'Asia/Chita')
var m2 = moment.tz([2016, 2, 27, 2, 0, 0, 0], 'Asia/Chita')
var m3 = moment.tz([2016, 2, 27, 3, 0, 0, 0], 'Asia/Chita')

console.log('A.', m1.valueOf(), m1.toString())
console.log('B.', m2.valueOf(), m2.toString())
console.log('C.', m3.valueOf(), m3.toString())

In Chrome 51 on Mac OS 10.11.4 I get the following result:

A. 1459015199000 Sun Mar 27 2016 01:59:59 GMT+0800
B. 1459015200000 Sun Mar 27 2016 03:00:00 GMT+0900
C. 1459018800000 Sun Mar 27 2016 04:00:00 GMT+0900

Since Asia/Chita moved from GMT+0800 to GMT+0900 the input arrays in both B. and C. must produce exactly the same result - Sun Mar 27 2016 03:00:00 GMT+0900 and timestamp 1459015200000.

However the date and timestamp in C. are different and wrong - 04:00:00 and 1459018800000

dmitryshimkin avatar Jul 29 '16 06:07 dmitryshimkin

Thanks for the bug report. I can confirm this, and will dig in further as soon as I can.

mattjohnsonpint avatar Aug 18 '16 07:08 mattjohnsonpint