JavaScript getTimezoneOffset() for January 1, 1970

前端 未结 1 1033
有刺的猬
有刺的猬 2021-01-26 18:56

I have the next case:

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

but

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


        
相关标签:
1条回答
  • 2021-01-26 19:16

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

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

    0 讨论(0)
提交回复
热议问题