I have following code:
var d = new Date('2016-03-27');
console.log(d.getDate(), d);
d.setDate(d.getDate() + 1);
console.log(d.getDate(), d);
Which gives incorrect answer:
27 Date 2016-03-27T00:00:00.000Z
28 Date 2016-03-27T23:00:00.000Z
Note on the second line dates does not match. It seems that it adds 24 hours instead one day. Locale is Latvia and in that day was time change by 1h.
Correct answer will be:
28 Date 2016-03-28T00:00:00.000Z
How I can work around this?