GNU bug report logs - #8930
date +%C

Previous Next

Package: coreutils;

Reported by: Dimitri Tassiaux <d.tassiaux <at> gmail.com>

Date: Fri, 24 Jun 2011 18:51:02 UTC

Severity: normal

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


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

From: Eric Blake <eblake <at> redhat.com>
To: 8930 <at> debbugs.gnu.org
Subject: Re: bug#8930: date +%C
Date: Fri, 24 Jun 2011 15:16:52 -0600
[Message part 1 (text/plain, inline)]
On 06/24/2011 01:52 PM, Eric Blake wrote:
> %C does not mean the century in common parlance, rather, according to
> POSIX, it means:
> 
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/date.html
> 
>>
>> %C
>>     Century (a year divided by 100 and truncated to an integer) as a decimal number [00,99].
> 
> Yes, the mnemonic is using century for lack of a better term, but it is
> correctly printing all but the last two digits of the year.

That said, you found a bug in POSIX.  %C can be larger than 99, since it
maps to the same construct in strftime().

http://austingroupbugs.net/view.php?id=466

-- 
Eric Blake   eblake <at> redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 14 years and 51 days ago.

Previous Next


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