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 #13 received at 8930-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Dimitri Tassiaux <d.tassiaux <at> gmail.com>, 8930-done <at> debbugs.gnu.org
Subject: Re: date +%C
Date: Fri, 24 Jun 2011 13:52:02 -0600
[Message part 1 (text/plain, inline)]
tag 8930 notabug
thanks

> ~$ *date*
> vendredi 24 juin 2011, 20:32:50 (UTC+0200)
> ~$ *date +%C*
> 20
> 
> 
> *# 21st Century !*
> 

Thanks for the report.  However, this is not a bug.

%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.

-- 
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.