I’m using the default Date() constructor to get the current Date of the user.
At the time of writing this, it’s 00:52, Monday (GMT) morning. When I trace the value of date.getDay(), I get Sunday printed.
Why does this happen? How can I set a timezone?
Cheers.
Date.getDay()will give you the day in local time. If you want universal time, useDate.getUTCDay().