Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

240
Visualizações
JS Date doesn't react to DST change

I have tested new Date() in the console and the return value doesn't depend on DST. But my PC's clock does. The difference between my PC's time and my browser's time
Look at the time difference in console and in the Windows taskbar. Thay are not the same.
How to fix that?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

JavaScript is doing the right thing. However, most browsers (Chrome, etc.) will only detect a change to Window's "Adjust for daylight saving time automatically" setting when all browser windows are closed and the browser is restarted.

That said, my best advice is that you should never turn the "Adjust for daylight saving time automatically" setting off. The setting only exists as an artifact of Window's history, and is only needed in some very rare edge cases these days. Leave it on.

You should also have "Set time automatically" turned on, as that will synchronize your computer's clock to the Internet.

For time zones, you can try using "Set time zone automatically" - which works in many cases but can sometimes pick the wrong time zone if you are connecting through a VPN. You can also turn that off and just pick your time zone from the list of time zones.


Just to demonstrate how buggy turning "Adjust for daylight saving time automatically" off can be, below is a screenshot from my fully updated Windows 11 machine. Notice if I turn it off that the time in the settings panel is an hour off from the time in the task bar. That is a bug in Windows that has appeared before and has apparently regressed again. Best to avoid it.

enter image description here

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda