Open leo108 opened 8 years ago
Confirmed:
var dt = '2016-11-06';
var z = 'America/Los_Angeles';
moment.tz(dt, z).hours(10).format() // "2016-11-06T10:00:00-08:00" (ok)
moment.tz(dt, z).minutes(600).format() // "2016-11-06T09:00:00-08:00" (bad)
moment.tz(dt, z).seconds(36000).format() // "2016-11-06T09:00:00-08:00" (bad)
moment.tz(dt, z).milliseconds(36000000).format() // "2016-11-06T09:00:00-08:00" (bad)
Without moment-timezone, and with local time set to Pacific, it works as expected:
var dt = '2016-11-06';
moment(dt).hours(10).format() // "2016-11-06T10:00:00-08:00" (ok)
moment(dt).minutes(600).format() // "2016-11-06T10:00:00-08:00" (ok)
moment(dt).seconds(36000).format() // "2016-11-06T10:00:00-08:00" (ok)
moment(dt).milliseconds(36000000).format() // "2016-11-06T10:00:00-08:00" (ok)
Here is my code:
Is that designed as that or a bug ?