Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

247
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda