[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#8930: date +%C
From: |
Eric Blake |
Subject: |
bug#8930: date +%C |
Date: |
Fri, 24 Jun 2011 15:16:52 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 |
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 address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature