mpliang
mpliang

Reputation: 11

Moment.js formatting time incorrectly?

moment.tz('2017-03-26T01:00:00', 'Europe/London').utc().format('YYYY-MM-DD[T]HH:mm:00')

returns: "2017-03-26T01:00:00Z" correctly

moment.tz('2017-03-26T02:00:00', 'Europe/London').utc().format('YYYY-MM-DD[T]HH:mm:00')

returns: "2017-03-26T01:00:00" instead of "2017-03-26T02:00:00"

moment.tz('2017-03-26T02:00:00Z', 'Europe/London').utc().format('YYYY-MM-DD[T]HH:mm:00')

returns "2017-03-26T02:00:00"

why is this?

Upvotes: 0

Views: 54

Answers (1)

Matt Johnson-Pint
Matt Johnson-Pint

Reputation: 241475

On March 26, 2016, DST began in London. By 2:00, the offset was UTC+01:00. Therefore, it is not going to be the same local time as UTC.

Upvotes: 2

Related Questions