]> granicus.if.org Git - php/commitdiff
(php_date) Fixed 'r' modifier to always return two digits for the day
authorSander Roobol <sander@php.net>
Fri, 8 Mar 2002 17:25:43 +0000 (17:25 +0000)
committerSander Roobol <sander@php.net>
Fri, 8 Mar 2002 17:25:43 +0000 (17:25 +0000)
value (see RFC 822) (#15952).

ext/standard/datetime.c

index d7fc392dcdfb11d459168beed5a70ef99b3654cd..6a63a6ca40e632e30d7867eab8d5090fa72e2df2 100644 (file)
@@ -496,7 +496,7 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
                                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 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
                                        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],