Jovian-Experiments / Jovian-NixOS

Discussions: https://matrix.to/#/#Jovian-Experiments:matrix.org
https://jovian-experiments.github.io/Jovian-NixOS/
MIT License
525 stars 51 forks source link

Time zone setting shows as "Pacific" in settings even though it's not #128

Open samueldr opened 1 year ago

samueldr commented 1 year ago

Split off from #125.


For the UI to show the "correct" timezone, it needs to be one of the 62 timezones the Steam Deck UI knows about:

SteamClient.Settings.GetAvailableTimeZones().then((a) => console.log(JSON.stringify(a)))
Long list ahead! ```json [ { "utcOffset": -1100, "timezoneID": "Pacific/Pago_Pago", "timezoneLocalizationToken": "#TimeZoneRegion_Samoa", "regionsLocalizationToken": "#TimeZoneCities_Samoa" }, { "utcOffset": -1000, "timezoneID": "Pacific/Honolulu", "timezoneLocalizationToken": "#TimeZoneRegion_Hawaii", "regionsLocalizationToken": "#TimeZoneCities_Hawaii" }, { "utcOffset": -900, "timezoneID": "America/Anchorage", "timezoneLocalizationToken": "#TimeZoneRegion_Alaska", "regionsLocalizationToken": "#TimeZoneCities_Alaska" }, { "utcOffset": -800, "timezoneID": "America/Los_Angeles", "timezoneLocalizationToken": "#TimeZoneRegion_Pacific", "regionsLocalizationToken": "#TimeZoneCities_Pacific" }, { "utcOffset": -700, "timezoneID": "America/Denver", "timezoneLocalizationToken": "#TimeZoneRegion_Mountain", "regionsLocalizationToken": "#TimeZoneCities_Mountain" }, { "utcOffset": -700, "timezoneID": "America/Chihuahua", "timezoneLocalizationToken": "#TimeZoneRegion_MountainMexico", "regionsLocalizationToken": "#TimeZoneCities_MountainMexico" }, { "utcOffset": -700, "timezoneID": "America/Phoenix", "timezoneLocalizationToken": "#TimeZoneRegion_MountainArizona", "regionsLocalizationToken": "#TimeZoneRegion_MountainArizona" }, { "utcOffset": -600, "timezoneID": "America/Chicago", "timezoneLocalizationToken": "#TimeZoneRegion_Central", "regionsLocalizationToken": "#TimeZoneCities_Central" }, { "utcOffset": -600, "timezoneID": "America/Costa_Rica", "timezoneLocalizationToken": "#TimeZoneRegion_CentralAmerica", "regionsLocalizationToken": "#TimeZoneCities_CentralAmerica" }, { "utcOffset": -600, "timezoneID": "Canada/Saskatchewan", "timezoneLocalizationToken": "#TimeZoneRegion_Central", "regionsLocalizationToken": "#TimeZoneCities_Saskatchewan" }, { "utcOffset": -500, "timezoneID": "America/New_York", "timezoneLocalizationToken": "#TimeZoneRegion_Eastern", "regionsLocalizationToken": "#TimeZoneCities_Eastern" }, { "utcOffset": -500, "timezoneID": "America/Indiana/Indianapolis", "timezoneLocalizationToken": "#TimeZoneRegion_Indiana", "regionsLocalizationToken": "#TimeZoneCities_Indiana" }, { "utcOffset": -500, "timezoneID": "America/Bogota", "timezoneLocalizationToken": "#TimeZoneRegion_SAmericaPacific", "regionsLocalizationToken": "#TimeZoneCities_SAmericaPacific" }, { "utcOffset": -400, "timezoneID": "America/Moncton", "timezoneLocalizationToken": "#TimeZoneRegion_Atlantic", "regionsLocalizationToken": "#TimeZoneCities_Atlantic" }, { "utcOffset": -400, "timezoneID": "America/Caracas", "timezoneLocalizationToken": "#TimeZoneRegion_SAmericaWestern", "regionsLocalizationToken": "#TimeZoneCities_SAmericaWestern" }, { "utcOffset": -400, "timezoneID": "America/Santiago", "timezoneLocalizationToken": "#TimeZoneRegion_Chile", "regionsLocalizationToken": "#TimeZoneCities_Chile" }, { "utcOffset": -330, "timezoneID": "America/St_Johns", "timezoneLocalizationToken": "#TimeZoneRegion_EastCanada", "regionsLocalizationToken": "#TimeZoneCities_EastCanada" }, { "utcOffset": -300, "timezoneID": "America/Sao_Paulo", "timezoneLocalizationToken": "#TimeZoneRegion_Brazil", "regionsLocalizationToken": "#TimeZoneCities_Brazil" }, { "utcOffset": -300, "timezoneID": "America/Argentina/Buenos_Aires", "timezoneLocalizationToken": "#TimeZoneRegion_SAmericaEast", "regionsLocalizationToken": "#TimeZoneCities_SAmericaEast" }, { "utcOffset": -300, "timezoneID": "America/Godthab", "timezoneLocalizationToken": "#TimeZoneRegion_Greenland", "regionsLocalizationToken": "#TimeZoneCities_Greenland" }, { "utcOffset": -100, "timezoneID": "Atlantic/Azores", "timezoneLocalizationToken": "#TimeZoneRegion_Azores", "regionsLocalizationToken": "#TimeZoneCities_Azores" }, { "utcOffset": -100, "timezoneID": "Atlantic/Cape_Verde", "timezoneLocalizationToken": "#TimeZoneRegion_CapeVerde", "regionsLocalizationToken": "#TimeZoneCities_CapeVerde" }, { "utcOffset": 0, "timezoneID": "Europe/Dublin", "timezoneLocalizationToken": "#TimeZoneRegion_GMT", "regionsLocalizationToken": "#TimeZoneCities_GMT" }, { "utcOffset": 100, "timezoneID": "Europe/Paris", "timezoneLocalizationToken": "#TimeZoneRegion_CentralEurope", "regionsLocalizationToken": "#TimeZoneCities_CentralEurope" }, { "utcOffset": 100, "timezoneID": "Africa/Lagos", "timezoneLocalizationToken": "#TimeZoneRegion_WestAfrica", "regionsLocalizationToken": "#TimeZoneCities_WestAfrica" }, { "utcOffset": 100, "timezoneID": "Africa/Harare", "timezoneLocalizationToken": "#TimeZoneRegion_CentralAfrica", "regionsLocalizationToken": "#TimeZoneCities_CentralAfrica" }, { "utcOffset": 200, "timezoneID": "Europe/Bucharest", "timezoneLocalizationToken": "#TimeZoneRegion_EasternEurope", "regionsLocalizationToken": "#TimeZoneCities_EasternEurope" }, { "utcOffset": 200, "timezoneID": "Asia/Jerusalem", "timezoneLocalizationToken": "#TimeZoneRegion_Israel", "regionsLocalizationToken": "#TimeZoneCities_Israel" }, { "utcOffset": 300, "timezoneID": "Europe/Moscow", "timezoneLocalizationToken": "#TimeZoneRegion_Moscow", "regionsLocalizationToken": "#TimeZoneCities_Moscow" }, { "utcOffset": 300, "timezoneID": "Asia/Kuwait", "timezoneLocalizationToken": "#TimeZoneRegion_Arabia", "regionsLocalizationToken": "#TimeZoneCities_Arabia" }, { "utcOffset": 300, "timezoneID": "Africa/Nairobi", "timezoneLocalizationToken": "#TimeZoneRegion_EastAfrica", "regionsLocalizationToken": "#TimeZoneCities_EastAfrica" }, { "utcOffset": 330, "timezoneID": "Asia/Tehran", "timezoneLocalizationToken": "#TimeZoneRegion_Iran", "regionsLocalizationToken": "#TimeZoneCities_Iran" }, { "utcOffset": 400, "timezoneID": "Asia/Muscat", "timezoneLocalizationToken": "#TimeZoneRegion_Arabian", "regionsLocalizationToken": "#TimeZoneCities_Arabian" }, { "utcOffset": 400, "timezoneID": "Asia/Baku", "timezoneLocalizationToken": "#TimeZoneRegion_Caucasus", "regionsLocalizationToken": "#TimeZoneCities_Caucasus" }, { "utcOffset": 430, "timezoneID": "Asia/Kabul", "timezoneLocalizationToken": "#TimeZoneRegion_Afghanistan", "regionsLocalizationToken": "#TimeZoneCities_Afghanistan" }, { "utcOffset": 500, "timezoneID": "Asia/Yekaterinburg", "timezoneLocalizationToken": "#TimeZoneRegion_Yekaterinburg", "regionsLocalizationToken": "#TimeZoneCities_Yekaterinburg" }, { "utcOffset": 500, "timezoneID": "Asia/Karachi", "timezoneLocalizationToken": "#TimeZoneRegion_WestAsia", "regionsLocalizationToken": "#TimeZoneCities_WestAsia" }, { "utcOffset": 530, "timezoneID": "Asia/Kolkata", "timezoneLocalizationToken": "#TimeZoneRegion_India", "regionsLocalizationToken": "#TimeZoneCities_India" }, { "utcOffset": 545, "timezoneID": "Asia/Kathmandu", "timezoneLocalizationToken": "#TimeZoneRegion_Nepal", "regionsLocalizationToken": "#TimeZoneCities_Nepal" }, { "utcOffset": 600, "timezoneID": "Asia/Dhaka", "timezoneLocalizationToken": "#TimeZoneRegion_CentralAsia", "regionsLocalizationToken": "#TimeZoneCities_CentralAsia" }, { "utcOffset": 600, "timezoneID": "Asia/Novosibirsk", "timezoneLocalizationToken": "#TimeZoneRegion_NorthCentralAsia", "regionsLocalizationToken": "#TimeZoneCities_NorthCentralAsia" }, { "utcOffset": 630, "timezoneID": "Asia/Rangoon", "timezoneLocalizationToken": "#TimeZoneRegion_Myanmar", "regionsLocalizationToken": "#TimeZoneCities_Myanmar" }, { "utcOffset": 700, "timezoneID": "Asia/Bangkok", "timezoneLocalizationToken": "#TimeZoneRegion_SoutheastAsia", "regionsLocalizationToken": "#TimeZoneCities_SoutheastAsia" }, { "utcOffset": 700, "timezoneID": "Asia/Krasnoyarsk", "timezoneLocalizationToken": "#TimeZoneRegion_NorthAsia", "regionsLocalizationToken": "#TimeZoneCities_NorthAsia" }, { "utcOffset": 800, "timezoneID": "Asia/Shanghai", "timezoneLocalizationToken": "#TimeZoneRegion_China", "regionsLocalizationToken": "#TimeZoneCities_China" }, { "utcOffset": 800, "timezoneID": "Asia/Singapore", "timezoneLocalizationToken": "#TimeZoneRegion_Singapore", "regionsLocalizationToken": "#TimeZoneCities_Singapore" }, { "utcOffset": 800, "timezoneID": "Asia/Taipei", "timezoneLocalizationToken": "#TimeZoneRegion_Taipei", "regionsLocalizationToken": "#TimeZoneCities_Taipei" }, { "utcOffset": 800, "timezoneID": "Australia/Perth", "timezoneLocalizationToken": "#TimeZoneRegion_WestAustralia", "regionsLocalizationToken": "#TimeZoneCities_WestAustralia" }, { "utcOffset": 800, "timezoneID": "Asia/Irkutsk", "timezoneLocalizationToken": "#TimeZoneRegion_NorthAsiaEast", "regionsLocalizationToken": "#TimeZoneCities_NorthAsiaEast" }, { "utcOffset": 900, "timezoneID": "Asia/Seoul", "timezoneLocalizationToken": "#TimeZoneRegion_Korea", "regionsLocalizationToken": "#TimeZoneCities_Korea" }, { "utcOffset": 900, "timezoneID": "Asia/Tokyo", "timezoneLocalizationToken": "#TimeZoneRegion_Japan", "regionsLocalizationToken": "#TimeZoneCities_Japan" }, { "utcOffset": 900, "timezoneID": "Asia/Yakutsk", "timezoneLocalizationToken": "#TimeZoneRegion_Yakutsk", "regionsLocalizationToken": "#TimeZoneCities_Yakutsk" }, { "utcOffset": 930, "timezoneID": "Australia/Darwin", "timezoneLocalizationToken": "#TimeZoneRegion_CentralAustraliaD", "regionsLocalizationToken": "#TimeZoneCities_CentralAustraliaD" }, { "utcOffset": 930, "timezoneID": "Australia/Adelaide", "timezoneLocalizationToken": "#TimeZoneRegion_CentralAustraliaA", "regionsLocalizationToken": "#TimeZoneCities_CentralAustraliaA" }, { "utcOffset": 1000, "timezoneID": "Australia/Sydney", "timezoneLocalizationToken": "#TimeZoneRegion_EasternAustralia", "regionsLocalizationToken": "#TimeZoneCities_EasternAustralia" }, { "utcOffset": 1000, "timezoneID": "Australia/Brisbane", "timezoneLocalizationToken": "#TimeZoneRegion_EasternAustraliaB", "regionsLocalizationToken": "#TimeZoneCities_EasternAustraliaB" }, { "utcOffset": 1000, "timezoneID": "Asia/Vladivostok", "timezoneLocalizationToken": "#TimeZoneRegion_Vladivostok", "regionsLocalizationToken": "#TimeZoneCities_Vladivostok" }, { "utcOffset": 1000, "timezoneID": "Pacific/Guam", "timezoneLocalizationToken": "#TimeZoneRegion_WestPacific", "regionsLocalizationToken": "#TimeZoneCities_WestPacific" }, { "utcOffset": 1100, "timezoneID": "Pacific/Guadalcanal", "timezoneLocalizationToken": "#TimeZoneRegion_CentralPacific", "regionsLocalizationToken": "#TimeZoneCities_CentralPacific" }, { "utcOffset": 1200, "timezoneID": "Pacific/Fiji", "timezoneLocalizationToken": "#TimeZoneRegion_Fiji", "regionsLocalizationToken": "#TimeZoneCities_Fiji" }, { "utcOffset": 1200, "timezoneID": "Pacific/Auckland", "timezoneLocalizationToken": "#TimeZoneRegion_NewZealand", "regionsLocalizationToken": "#TimeZoneCities_NewZealand" }, { "utcOffset": 1300, "timezoneID": "Pacific/Tongatapu", "timezoneLocalizationToken": "#TimeZoneRegion_Tonga", "regionsLocalizationToken": "#TimeZoneCities_Tonga" } ] ```
samueldr commented 1 year ago

Originally from @misuzu


So setting time.timeZone to null should allow changing timezone in steam.

I've set timezone using sudo timedatectl set-timezone Europe/Bucharest with time.timeZone = null; in config. The correct time is shown in the right upper corner and proper timezone is displayed in the steam settings. But when I try to change timezone there it still doesn't work. Here how it looks in journal:

Aug 11 23:24:41 nijika systemd[1]: Starting Time & Date Service...
Aug 11 23:24:41 nijika systemd[1]: Started Time & Date Service.
Aug 11 23:24:41 nijika jovian-session[2420]: JSSetTimeZone: system() failed, errno 2
VergeDX commented 2 days ago

Not sure this is the same issue, my timezone is "Asia/Shanghai" but Steam UI shows UTC-6...

[root@NixOS-SD:~]# timedatectl 
               Local time: Tue 2024-11-12 21:24:57 CST
           Universal time: Tue 2024-11-12 13:24:57 UTC
                 RTC time: Tue 2024-11-12 13:24:57
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

[root@NixOS-SD:~]# date 
Tue Nov 12 09:24:59 PM CST 2024

[root@NixOS-SD:~]# steam-run date 
Tue Nov 12 09:25:02 PM CST 2024

As well as UI shows 7:29 AM.

K900 commented 2 days ago

The Steam UI hardcodes its own (and very old) copy of tzdata for some reason. Not much we can do here really. I wonder if you can somehow monkey-patch it with a Decky plugin or something...

samueldr commented 2 days ago

For the record:

As well as UI shows [the wrong time].

This part might be #125; where time zones not part of the tzdata from the Steam client causes the time to be wrong.


The Steam UI hardcodes its own (and very old) copy of tzdata for some reason.

For the gory details, it's as far as I could tell coming from the old chromium or old chromium dependencies involved, which in turn had that ancient tzdata bundled into it...

I wonder if you can somehow monkey-patch it with a Decky plugin or something...

It's the browser's innate date handling that needs to be corrected in this situation. It might be able to force the time at specific locations to be correct, but other locations would report the wrong one. So short from being able to hijack the browser-native functions before any of the Steam code runs, I believe it'd end-up incomplete.

VergeDX commented 1 day ago

The Steam UI hardcodes its own (and very old) copy of tzdata for some reason. Not much we can do here really. I wonder if you can somehow monkey-patch it with a Decky plugin or something...

Yes but my timezone "Asia/Shanghai" in the list of SteamClient.Settings 😂