I want to get current date UTC midnight:
var d = new Date();
d.setUTCHours(0,0,0,0);
console.log(d.toISOString())
This returns me:
2016-04-21T00:00:00.000Z
Is this UTC time? I think it is not and it should be:
2016-04-20T22:00:00.000Z
I want to get current date UTC midnight:
var d = new Date();
d.setUTCHours(0,0,0,0);
console.log(d.toISOString())
This returns me:
2016-04-21T00:00:00.000Z
Is this UTC time? I think it is not and it should be:
2016-04-20T22:00:00.000Z
If you want to have midnight of your time zone in UTC time then the code is as following:
var d = new Date();
d.setHours(0,0,0,0);
console.log(d.toISOString());