javascript-tutorial / en.javascript.info

Modern JavaScript Tutorial

Home Page:https://javascript.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Date and time tasks don't make sense (if not in UTC)

Sammeeey opened this issue · comments

Maybe there's an error in my logic.
But all the tasks & solutions in Date and time don't really make sense if you aren't coincidentally living in UTC+0, right?

My Win 10 always displays dates with 1 hour delay (because I'm in central European summer time UTC+1):
console.log(new Date(2012,2,1)) doesn't display 1st of March but 2012-02-29T23:00:00.000Z

Shouldn't the tasks explicitly work with UTC time zone & the respective methods, in order to make results inclusive?