JavaScript getTimezoneOffset() for January 1, 1970

I have the next case:

new Date().timezoneOffset() //returns -180. That's ok.

but

new Date(0).timezoneOffset() //returns -120.

Please help me to understand why new Date(0).timezoneOffset() returns -120 instead of -180.

Answers:

Answer

That's the effect of Daylight Savings or "Summer" time.

If it were December right now, you would not have asked the question :)

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.