Output format of 'date' command has changed and breaks scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I just updated my remote server to 20.04.1 (from 18.04.x), and now the date command outputs the time like so:
$ date
Sat 03 Oct 2020 03:00:20 PM CEST
with AM/PM, instead of the 24-hour format it used before.
This breaks scripts that rely on the output from the date command (and also users who are used to 24 hour format are highly annoyed).
My locale is pretty default:
$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE=
LC_NUMERIC=
LC_TIME=
LC_COLLATE=
LC_MONETARY=
LC_MESSAGES=
LC_PAPER=
LC_NAME=
LC_ADDRESS=
LC_TELEPHONE=
LC_MEASUREMENT=
LC_IDENTIFICATI
LC_ALL=en_US.UTF-8
One would think that changing LC_TIME might influence the output:
$ LC_TIME=C date
Sat 03 Oct 2020 03:01:56 PM CEST
No, it doesn't. Nor do LC_NUMERIC, LC_MESSAGES, etc:
$ LC_NUMERIC=C date
Sat 03 Oct 2020 03:02:36 PM CEST
$ LC_MESSAGES=C date
Sat 03 Oct 2020 03:02:41 PM CEST
$ LC_CTYPE=C date
Sat 03 Oct 2020 03:02:47 PM CEST
$ LC_MEASUREMENT=C date
Sat 03 Oct 2020 03:03:12 PM CEST
Only LC_ALL seems to have an influence:
$ LC_ALL=C date
Sat Oct 3 15:03:19 CEST 2020
This seems wrong. At least LC_TIME should have an effect here, and it would be even better if basic system utilities didn't just randomly change their output format.
Please change it back.
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: coreutils 8.30-3ubuntu2
ProcVersionSign
Uname: Linux 5.4.0-48-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.9
Architecture: amd64
CasperMD5CheckR
Date: Sat Oct 3 14:56:31 2020
ProcEnviron:
TERM=screen.
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: coreutils
UpgradeStatus: Upgraded to focal on 2020-10-02 (1 days ago)