Re: Problem with Date Command

2008-06-06 Thread Jim Meyering
Eric Blake [EMAIL PROTECTED] wrote:
 [off-list, since the bulk of the patch is email addresses ;)]

 According to Philip Rowlands on 6/5/2008 7:15 AM:
 | Either the command needs to be changed or the man page needs to be
 | changed to express what the command actually does.  Any assistance
 | would be appreciated.
 |
 | I agree that until 2100, it would be better if the manpage gave 20 as
 | the example, or no example at all, but the wording is strictly correct.

 Jim, how about the following?

That's a definite improvement.  Pushed.
Thanks!

 Subject: [PATCH] improve 'date +%C' documentation

 * src/date.c (usage): Use 20, not 21, for current century.
 * THANKS: Update.
 Reported by Dameon G. Rogers, fix suggested by Philip Rowlands.
 ---
  THANKS |2 ++
  src/date.c |2 +-
  2 files changed, 3 insertions(+), 1 deletions(-)

 diff --git a/THANKS b/THANKS
 index feaf463..cb9b098 100644
 --- a/THANKS
 +++ b/THANKS
 @@ -110,6 +110,7 @@ Cray-Cyber Project  
 http://www.cray-cyber.org
  Cristian Cadar  [EMAIL PROTECTED]
  Cyril Bouthors  [EMAIL PROTECTED]
  Dale Scheetz[EMAIL PROTECTED]
 +Dameon G. Rogers[EMAIL PROTECTED]
  Dan Hagerty [EMAIL PROTECTED]
  Dan Jacobsonhttp://www.geocities.com/jidani
  Dan Pascu   [EMAIL PROTECTED]
 @@ -434,6 +435,7 @@ Peter Seebach   [EMAIL PROTECTED]
  Petter Reinholdtsen [EMAIL PROTECTED]
  Phelippe Neveu  [EMAIL PROTECTED]
  Phil Richards   [EMAIL PROTECTED]
 +Philip Rowlands [EMAIL PROTECTED]
  Philippe De Muyter  [EMAIL PROTECTED]
  Philippe Schnoebelen[EMAIL PROTECTED]
  Phillip Jones   [EMAIL PROTECTED]
 diff --git a/src/date.c b/src/date.c
 index 86b3225..aa4d69d 100644
 --- a/src/date.c
 +++ b/src/date.c
 @@ -166,7 +166,7 @@ specifies Coordinated Universal Time.  Interpreted 
 sequences are:\n\
%c   locale's date and time (e.g., Thu Mar  3 23:05:25 2005)\n\
  ), stdout);
fputs (_(\
 -  %C   century; like %Y, except omit last two digits (e.g., 21)\n\
 +  %C   century; like %Y, except omit last two digits (e.g., 20)\n\
%d   day of month (e.g, 01)\n\
%D   date; same as %m/%d/%y\n\
%e   day of month, space padded; same as %_d\n\


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Problem with Date Command

2008-06-05 Thread Dameon G. Rogers

Bug-coreutils,

   I would like to report a problem with the *date* command:

date +%C

does not function properly.  It says it displays the current 
century but the/ definition /of century means that we are in the 21st 
not the 20th.  Either the command needs to be changed or the man page 
needs to be changed to express what the command actually does.  Any 
assistance would be appreciated.


D. Rogers

--
***

President - Association of Computing Machinery
[EMAIL PROTECTED]
[EMAIL PROTECTED]

***



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: Problem with Date Command

2008-06-05 Thread Eric Blake

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Dameon G. Rogers on 6/4/2008 10:09 PM:
| Bug-coreutils,
|
|I would like to report a problem with the *date* command:
|
| date +%C
|
| does not function properly.  It says it displays the current century

'date --help' (and thus the man page) defines what it is using as century:

~  %C   century; like %Y, except omit last two digits (e.g., 21)

In other words, it is not the English definition, so much as (year % 100).
~ As the behavior of %C is specified by POSIX, about all we could do is
change the description - any proposed wordings that would make this more
clear to you?

- --
Don't work too hard, make some time for fun as well!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhH1f4ACgkQ84KuGfSFAYAp+QCeO/bZzdf3bwtBkeCs64/37YlS
VPwAn0nuPgw0/QwgYja96Q0Hk5/0xjRL
=+wAK
-END PGP SIGNATURE-


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: Problem with Date Command

2008-06-05 Thread Philip Rowlands

On Wed, 4 Jun 2008, Dameon G. Rogers wrote:


Bug-coreutils,

  I would like to report a problem with the *date* command:

date +%C

   does not function properly.  It says it displays the current 
century but the/ definition /of century means that we are in the 21st 
not the 20th.


The documentation does not state that %C is the ordinal century; in the 
manpage/--help output, we see:


  %C   century; like %Y, except omit last two digits (e.g., 21)
  %Y   year

and from the info documentation:

`%C'
 century.  This is like `%Y', except the last two digits are
 omitted.  For example, it is `20' if `%Y' is `2000', and is `-0'
 if `%Y' is `-001'.  It is normally at least two characters, but it
 may be more.

Either the command needs to be changed or the man page needs to be 
changed to express what the command actually does.  Any assistance 
would be appreciated.


I agree that until 2100, it would be better if the manpage gave 20 as 
the example, or no example at all, but the wording is strictly correct.



Cheers,
Phil


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: Problem with Date Command

2008-06-05 Thread Andreas Schwab
Dameon G. Rogers [EMAIL PROTECTED] writes:

 Bug-coreutils,

I would like to report a problem with the *date* command:

 date +%C

 does not function properly.  It says it displays the current century
 but the/ definition /of century means that we are in the 21st not the
 20th.

The ducumentation is pretty clear on the meaning:

  `%C'
   century.  This is like `%Y', except the last two digits are
   omitted.  For example, it is `20' if `%Y' is `2000', and is `-0'
   if `%Y' is `-001'.  It is normally at least two characters, but it
   may be more.

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils