What is the explanation for such behavior ?
> new Date('2017-12-01T22:35:20').getDay()
5
> new Date('2017-12-01T22:35:20Z').getDay()
6
What is the explanation for such behavior ?
> new Date('2017-12-01T22:35:20').getDay()
5
> new Date('2017-12-01T22:35:20Z').getDay()
6
Z means 'Zulu time', AKA 'UTC'. If you omit the Z
you get a Date object in your local timezone.