Answer the question
In order to leave comments, you need to log in
Why does new Date() return the wrong time in JavaScript?
You need to get the user's timezone in the browser. new Date().getTimezoneOffset() gives me -120 when it should give -180 because I have UTC +3. Also, new Date() itself returns the wrong time, instead of 11 hours it returns 10 and the time zone +2, respectively. How can I get the user's actual time?
Answer the question
In order to leave comments, you need to log in
The same problem was in Google Chrome, I broke my whole head. It turned out that the browser developers screwed up, because. everything is fine in other browsers. Fixed it in the next update.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question