OSSystems / meta-browser

OpenEmbedded/Yocto BSP layer for Web Browsers
MIT License
183 stars 189 forks source link

Chromium on Linux does not handle all timezones correctly #737

Open boyd-ty opened 1 year ago

boyd-ty commented 1 year ago

Running a react web app which displays time based on timezone and the timezone and set to a common timezone US/Pacific, Chromium (version 114.0.5735.198). This react web app periodically updates the time that is displayed so that it is relatively synced with the underlying system.

I set on the Linux system the timezone Pacific/Guam. Chromium does not update the timezone and keeps the previous timezone that Chromium does handle correctly. This seems to be an issue for most of the Pacific group timezones, Asia group timezones, for some reason Etc group which has the GMT+/- offset, among others.

Is there a workaround or a version where these timezones do work in Chromium running on Linux? The windows version seems to have no issues. I changed the timezone of my windows machine to see the react app time update appropriately.

I did find an issue fairly similar to what I am experiencing logged against Chromium. https://bugs.chromium.org/p/chromium/issues/detail?id=1146599&q=localtime&can=2

kraj commented 1 year ago

did you package all the timezone resource files into image ? defaults on OE/yocto is not do package all of the data. secondly, when you switch the timezone, what process/cmds did you use ?

boyd-ty commented 1 year ago

All the timezones are packaged and are available on my Linux system. Changing the timezone on the system involves change the symlink /etc/localtime to point to the desired timezone data in the timezone database. Running the date command on the Linux system results in the expected timezone to be applied.

boyd-ty commented 1 year ago

If this is of any use, I am using the javascript calls to the browser to get the local time without setting the timezone so that I get what the system has set for timezone through the browser. Using a Date object obtain though 'new Date()' (example currentDate=new Date(), I make calls to currentDate.toLocaleDateString('en-US') and currentDate.toLocaleTimeString('en-US', {hour12: true, timeZoneName: 'short'}).