When using moment.tz to convert a specific date and time to UTC while considering the Europe/London timezone, there seems to be an issue. For example:
moment.tz('2017-03-26T01:00:00', 'Europe/London').utc().format('YYYY-MM-DD[T]HH:mm:00')
This code returns: "2017-03-26T01:00:00Z" as expected.
However, when changing the input time to 02:00:00 like this:
moment.tz('2017-03-26T02:00:00', 'Europe/London').utc().format('YYYY-MM-DD[T]HH:mm:00')
The output unexpectedly becomes: "2017-03-26T01:00:00" instead of "2017-03-26T02:00:00". This discrepancy is puzzling and warrants further investigation.
Alternatively, if the time input includes a 'Z' at the end like this:
moment.tz('2017-03-26T02:00:00Z', 'Europe/London').utc().format('YYYY-MM-DD[T]HH:mm:00')
The result correctly appears as "2017-03-26T02:00:00". The reason behind this inconsistency remains unclear, sparking questions about the internal logic of the conversion process.