Javascript is fun
a = new Date('2019-03-31T00:00:00.000Z');
a.setDate(a.getDate() + 1);
console.log(a);
Firefox macos | Safari macos | chrome macos |
---|---|---|
2019-03-31T23:00:00.000Z | Mon Apr 01 2019 00:00:00 GMT+0100 (BST) | Mon Apr 01 2019 00:00:00 GMT+0100 (British Summer Time) |
however,
a = new Date('2019-03-31T00:00:00.000Z');
b = new Date(a.getTime()+1000*60*60*24);
console.log(b);
Firefox macos | Safari macos | chrome macos |
---|---|---|
2019-04-01T00:00:00.000Z | Mon Apr 01 2019 01:00:00 GMT+0100 (BST) | Mon Apr 01 2019 01:00:00 GMT+0100 (British Summer Time) |