Thank you for taking the time to submit a report.  However I think you
are confused by the documentation.  :-)

[EMAIL PROTECTED] wrote:
> I think there is a wrong algorithm in your date function when using
> the %C argument for displaying the current century. your algorithm
> (year divided by 100 and truncated to an integer) gives the 20th
> century for the year 2004.  but obviously that's not correct, so
> there has to be added a "+ 1" to your algorithm.

Here is what the standards documents say about it.

  http://www.unix-systems.org/single_unix_specification_v2/xcu/date.html

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

For example, this should return the current year.

  date +%C%y
  2004

Bob


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to