GNU bug report logs - #55183
date

Previous Next

Package: coreutils;

Reported by: danilopereira82 <at> tutanota.com

Date: Fri, 29 Apr 2022 14:10:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55183 in the body.
You can then email your comments to 55183 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#55183; Package coreutils. (Fri, 29 Apr 2022 14:10:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to danilopereira82 <at> tutanota.com:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 29 Apr 2022 14:10:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: danilopereira82 <at> tutanota.com
To: bug-coreutils <at> gnu.org
Subject: date
Date: Fri, 29 Apr 2022 14:59:31 +0200 (CEST)
%r has a space at the end that makes me insanely angry fix it




Information forwarded to bug-coreutils <at> gnu.org:
bug#55183; Package coreutils. (Fri, 29 Apr 2022 16:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 55183 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: danilopereira82 <at> tutanota.com, 55183 <at> debbugs.gnu.org
Subject: Re: bug#55183: date
Date: Fri, 29 Apr 2022 17:24:01 +0100
tag 55183 notabug
close 55183
stop

On 29/04/2022 13:59, danilopereira82--- via GNU coreutils Bug Reports wrote:
> %r has a space at the end that makes me insanely angry fix it

What's happening is there is no "am_pm" item defined for your locale.
Running this with a locale that does define it, you can see:

  $ LC_TIME=C date +%r
  05:00:50 PM

  $ LC_TIME=zh_CN.utf8 date +%r
  下午 05时00分50秒

You can look up these values with:

  $ LC_TIME=C locale t_fmt_ampm t_fmt am_pm
  %I:%M:%S %p
  %H:%M:%S
  AM;PM

Note "t_fmt_ampm" if defined, takes precedence over "t_fmt ampm".

You could argue that an empty ampm should not output the space,
but that would have to be addressed in the libc strftime() implementation.

Another option is to use the more abstract %X format
to get the time in the most appropriate for one's locale,
which should be setup appropriately for locales that don't use AM/PM.

  $ LC_ALL=C date +%X
  17:00:50
  $ LC_ALL=en_US.utf8 date +%X
  05:00:50 PM
  $ LC_ALL=pt_PT.utf8 date +%X
  17:00:50

cheers,
Pádraig




Added tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Fri, 29 Apr 2022 16:25:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 55183 <at> debbugs.gnu.org and danilopereira82 <at> tutanota.com Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Fri, 29 Apr 2022 16:25:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 28 May 2022 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 332 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.