[Bug 2092236] Re: unknown time zone in $TZ quietly causes havoc
Ian! D. Allen
2092236 at bugs.launchpad.net
Wed Jan 15 17:57:35 UTC 2025
** Also affects: coreutils
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/2092236
Title:
unknown time zone in $TZ quietly causes havoc
Status in coreutils:
New
Status in coreutils package in Ubuntu:
New
Status in tzdata package in Ubuntu:
Invalid
Bug description:
See https://askubuntu.com/questions/1528949/time-setting-problems-
with-ubuntu-24-04
EDIT: All the problems below come from having set `TZ` to a non-
existent (under Ubunto 24.04) time zone `Canada/Eastern` in my
`.bashrc` and `.bash_profile`. That old zone name was replaced by
`America/Toronto` some time ago and the legacy `Canada/Eastern` zone
name was deleted in Ubuntu 24.04.1. Unfortunately, you don't get any
error messages from programs when `TZ` has an invalid value in it such
as `Canada/Eastern`. The `date` command outputs UTC and just prints
`Canada` as the time zone, and the GUI misbehaves badly as described
below. So let this be a bug report about how awful many programs are
about coping with an invalid value in `TZ`, including the GUI.
Report:
I upgraded two laptops from 22.04 to 24.04.1 and both resulted in an
inability to set the time zone correctly using the GUI settings. The
notification bar showed the time in UTC, not EST, at the top centre.
My `/etc/timezone` contains `America/Toronto`, which should cause
dates to display as EST (which they did before the upgrade to
24.04.1).
I would select and save `America/Toronto UTC-05:00` in the GUI and
then the GUI would display `UTC (Toronto, Canada)`. Toronto is EST,
not UTC.
The output of the `date` command was always in UTC, and the time zone
was listed as the bogus `Canada` time zone instead of the correct EST:
$ echo $TZ
Canada/Eastern
$ date
Thu Dec 19 18:50:46 Canada 2024
The output of `timedatectl` was correct, showing the correct EST time
zone:
$ timedatectl
Local time: Thu 2024-12-19 14:26:09 EST
Universal time: Thu 2024-12-19 19:26:09 UTC
RTC time: Thu 2024-12-19 19:26:09
Time zone: America/Toronto (EST, -0500)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
Downgrading from 2024 to `tzdata_2022a-0ubuntu1_all.deb` fixed the
problem on both machines; the time is correct and the `date` command
shows the time zone is now EST:
# date
Thu Dec 19 19:37:35 Canada 2024
# dpkg -i /tmp/tzdata_2022a-0ubuntu1_all.deb
dpkg: warning: downgrading tzdata from 2024a-3ubuntu1.1 to 2022a-0ubuntu1
(Reading database ... 217864 files and directories currently installed.)
Preparing to unpack .../tzdata_2022a-0ubuntu1_all.deb ...
Unpacking tzdata (2022a-0ubuntu1) over (2024a-3ubuntu1.1) ...
Setting up tzdata (2022a-0ubuntu1) ...
Current default time zone: 'America/Toronto'
Local time is now: Thu Dec 19 14:37:52 EST 2024.
Universal Time is now: Thu Dec 19 19:37:52 UTC 2024.
Run 'dpkg-reconfigure tzdata' if you wish to change it.
# date
Thu Dec 19 14:37:53 EST 2024
ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: tzdata 2022a-0ubuntu1
ProcVersionSignature: Ubuntu 6.8.0-51.52-generic 6.8.12
Uname: Linux 6.8.0-51-generic x86_64
ApportVersion: 2.28.1-0ubuntu3.3
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Thu Dec 19 14:08:18 2024
InstallationDate: Installed on 2020-09-08 (1563 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
PackageArchitecture: all
SourcePackage: tzdata
UpgradeStatus: Upgraded to noble on 2024-11-28 (22 days ago)
To manage notifications about this bug go to:
https://bugs.launchpad.net/coreutils/+bug/2092236/+subscriptions
More information about the foundations-bugs
mailing list