When Local Clock set to 12AM hour, Chrome returns incorrect TZ values
See original GitHub issueDescribe the bug Steps:
- set your local clock time on your machine to the 12AM hour
- have a script that loads dayjs and extends utc & timezone
- open firefox and run command in console:
- open chrome or MS edge and run the same command in console
dayjs .tz( dayjs().format('YYYY-MM-DD HH:mm'), // get local date and time 'America/Los_Angeles' ) .day(2) // set it to Tuesday .hour(23) // set the hour late in the day .minute(1) // set some random minute .tz('America/Chicago') // now convert it to a tz for the next day (should be wednesday) .format(`dddd h:mm A [America/Chicago]`);
Expected behavior
- The day should be set to Wednesday when converting, but Chrome is saying it’s Tuesday.
- Issue does not happen outside of the 12:00-12:59AM window

Information
- Day.js Version: 1.8.35
- OS: MacOS Catalina 10.15.6
- Browser:
- Failing Chrome Based browsers:
- Chrome 85.0.4183.83
- MS Edge 85.0.564.44
- Succeeds in Firefox:
- Firefox 80.0.1
- Failing Chrome Based browsers:
- Time zone: GMT-07:00 DST (Pacific Daylight Time)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Time display incorrect - Google Chrome Community
On your Windows device, open the settings application. Navigate to Date & time. Under Time zone, select a time zone different from your...
Read more >17535 - wrong time zone in gmail when using chrome - Monorail
Same problem on Arch Linux using chromium r42934. My time zone is GMT+1, displayed times in GMail and other web applications is 9...
Read more >Wrong time zone displayed in Calendar when set from network
If I lock an event to a TZ, then it is displayed incorrectly in my current TZ. E.g. I have a 5am flight...
Read more >Clock displaying incorrect timezone? - Help Center
Clock displaying incorrect timezone? · Type/enter: about:config into your address/URL bar. · Search for the 'privacy.resistfingerprinting' setting ...
Read more >Incorrect time in Home Assistant, time zone is set correctly ...
Hi everybody, can you please help me correct my settings to actually use to local time? I run a Docker container, where I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, I can reproduce this issue after changing my system timezone to
GMT-07:00and time to 12:59 AM (yes, it’s available in this locale)However, I don’t know why there’s a different result between chrome and firefox.
I’ll mark this as a bug and digging it deeply later.
although i still think this is a bug, my workaround is that i’ve explicitly defined the time in the beginning to always be
12:00instead of relying on the local time (which could at some point be between00:00and00:59)