[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug found on date command

From: Bob Proulx
Subject: Re: bug found on date command
Date: Wed, 3 Nov 2004 00:14:57 -0700
User-agent: Mutt/1.5.6+20040907i

address@hidden wrote:
>   There is a serious bug on date command. when i type " date +%C " i get the
> outout " 20 " instead of " 21 " . I hope you fix this bug soon. There may be
> some Linux users thinking that they are living at the 20th century :)

Here is what the standards documents say about it.

  Century (a year divided by 100 and truncated to an integer) as a
  decimal number [00-99].

The algorithm is explicit that %C is the two digit century part of the
current year.  This is not the same as the 20th or 21st century
definition.  It is instead used to slice up the date into component

For example, this should return the current year.

  date +%C%y


reply via email to

[Prev in Thread] Current Thread [Next in Thread]