Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!