简体   繁体   English

JavaScript在同一台计算机上提供了不同的时区

[英]Javascript gives different timezone on the same machine

The google chrome console is returning different timezones if I initialize the Date with a parameter or not. 如果我使用参数初始化Date,则Google Chrome控制台会返回不同的时区。

JavaScript日期 In another machine the same code give me the right result: 在另一台机器上,相同的代码给我正确的结果:

JavaScript日期 It's weird but it's happening 很奇怪,但是正在发生

I assume is Daylight Savings Time (DTS). 我假设是夏令时(DTS)。

As it seems from the logs, the computers are not in the same location, and it seems that in Brazil, DTS is adopted regionally , applicable at the beginning of November. 从日志中可以看出,计算机不在同一位置,并且在巴西, DTS似乎是在区域内采用的 ,适用于11月初。

A quick way to test if this is true, try creating an October date instead of November. 一种测试是否正确的快速方法,请尝试创建一个十月日期而不是十一月。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM