There are datetime strings that were concatenated from date and time values:
const localDatetime = `2017-01-01T12:00`;
const utcDatetime = `2017-01-01T12:00`;
and supposed to be converted to Date
object.
In Firefox it is accepted as local time:
new Date('2017-06-12T12:00').toISOString() === '2017-06-12T08:00:00.000Z'
And in Chrome it is accepted as UTC time:
new Date('2017-06-12T12:00').toISOString() === '2017-06-12T12:00:00.000Z'
This looks inconsistent, to say at least.
What is the explanation for that? Which of these browsers is right and why?
What is cross-browser solution to perform this transformation properly for both local and UTC strings?