c/3190 Re: warning: `%y' yields only last 2 digits of year

Robert Dewar dewar@gnat.com
Tue Mar 12 15:16:00 GMT 2002


The following reply was made to PR c/3190; it has been noted by GNATS.

From: dewar@gnat.com (Robert Dewar)
To: dewar@gnat.com, jsm28@cam.ac.uk
Cc: clock@atrey.karlin.mff.cuni.cz, gcc-gnats@gcc.gnu.org,
	gcc@gcc.gnu.org, geoffk@geoffk.org
Subject: Re: c/3190 Re: warning: `%y' yields only last 2 digits of year
Date: Tue, 12 Mar 2002 18:06:33 -0500 (EST)

 <<That date has six possible interpretations (the order of preference
 between them being culturally dependent).  Unless you have some
 arrangement as to the interpretation of such dates with anyone who might
 read them, they hardly seem like a good idea to write - certainly, when
 such dates appear on web pages, they generally are confusing and it's a
 matter of second-guessing the intent of the writer.  I'd always use
 yyyy-mm-dd (ISO 8601 format) in such a case, given a free-format date
 field.
 >>
 
 Wait a moment, you are obfuscating with irrelevancy here :-)
 
 I *specifically* talked about the date on a check (and given the spelling,
 I had in mind a US check, and not a british cheque). The interpretation
 of the date is quite unambiguous here, and I definitely do NOT suggest
 thgat you try to use the ISO format in that context.
 
 Actually I prefer in more general contexts to write something like 
 Mar 16 '02 which is clear to all (of course in those very rare contexts
 where the century is not clear from context it is OK to use 2002).
 
 But all this irrelevant discussion has nothing to do with the warning. 
 %y is a perfectly well defined, and useful function. it is reasonable
 to assume that anyone using this function knows what it does and means
 to use it.
 
 By the way, I have often filled out goverment forms that allowed precisely
 two digits for the year :-)



More information about the Gcc-prs mailing list