Re: cvs: php4 /ext/standard datetime.c

From: Date: Sat, 09 Mar 2002 11:21:19 +0000
Subject: Re: cvs: php4 /ext/standard datetime.c
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9850@lists.php.net to get a copy of this message
Damn... both 1 and 2 digits are allowed. I've overlooked the meaning of 1*2DIGIT. From RFC 822 (http://www.rfc-editor.org/rfc/rfc822.txt):
     5.1.  SYNTAX
     (...)
     date        =  1*2DIGIT month 2DIGIT        ; day month year
                                                 ;  e.g. 20 Jun 82
     (...)
And...
     2.4.  *RULE:  REPETITION
          The character "*" preceding an element indicates repetition.
     The full form is:
                              <l>*<m>element
     indicating at least <l> and at most <m> occurrences  of  element.
     Default values are 0 and infinity so that "*(element)" allows any
     number, including zero; "1*element" requires at  least  one;  and
     "1*2element" allows one or two.
So 1 digit is allowed too. I'll revert the patch. Sorry for the fuss :) Sander On 2002.03.09 07:43 derick@php.net wrote:
Hello Sander, if the RFC explicitly specifies 2 digits, please merge this fix into the branch. I'd like to see the sepcs though (RFC), do you have any pointer/ Derick On Fri, 8 Mar 2002, Sander Roobol wrote: sander Fri Mar 8 12:25:43 2002 EDT Modified files:
    /php4/ext/standard	datetime.c
Log: (php_date) Fixed 'r' modifier to always return two digits for the day value (see RFC 822) (#15952). Index: php4/ext/standard/datetime.c diff -u php4/ext/standard/datetime.c:1.83 php4/ext/standard/datetime.c:1.84 --- php4/ext/standard/datetime.c:1.83 Mon Mar 4 06:11:25 2002 +++ php4/ext/standard/datetime.c Fri Mar 8 12:25:43 2002 @@ -19,7 +19,7 @@ */ -/* $Id: datetime.c,v 1.83 2002/03/04 11:11:25 stas Exp $ */ +/* $Id: datetime.c,v 1.84 2002/03/08 17:25:43 sander Exp $ */ #include "php.h" @@ -496,7 +496,7 @@ break; case 'r': #if HAVE_TM_GMTOFF - sprintf(tmp_buff, "%3s, %2d %3s %04d %02d:%02d:%02d %c%02d%02d", + sprintf(tmp_buff, "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d", day_short_names[ta->tm_wday], ta->tm_mday, mon_short_names[ta->tm_mon], @@ -509,7 +509,7 @@ abs( ta->tm_gmtoff % 3600) ); #else - sprintf(tmp_buff, "%3s, %2d %3s %04d %02d:%02d:%02d %c%02d%02d", + sprintf(tmp_buff, "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d", day_short_names[ta->tm_wday], ta->tm_mday, mon_short_names[ta->tm_mon], -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ----------------------------------------------------------------------
              PHP: Scripting the Web - derick@php.net
                All your branches are belong to me!
            SRM: Site Resource Manager - www.vl-srm.net
----------------------------------------------------------------------- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.cvs (#9850) next »