date - How to get correct UTC time in javascript? -


i want 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 utc time? think not , should be:

2016-04-20t22:00:00.000z 

if want have midnight of time zone in utc time code following:

var d = new date(); d.sethours(0,0,0,0); console.log(d.toisostring()); 

Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -