Public bug reported:

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="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
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
ProcVersionSignature: Ubuntu 5.4.0-48.52-generic 5.4.60
Uname: Linux 5.4.0-48-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.9
Architecture: amd64
CasperMD5CheckResult: skip
Date: Sat Oct  3 14:56:31 2020
ProcEnviron:
 TERM=screen.xterm-256color
 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)

** Affects: coreutils (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal uec-images

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1898361

Title:
  Output format of 'date' command has changed and breaks scripts

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1898361/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to