]> granicus.if.org Git - php/commitdiff
- Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9).
authorDerick Rethans <derick@php.net>
Tue, 30 Aug 2005 09:17:09 +0000 (09:17 +0000)
committerDerick Rethans <derick@php.net>
Tue, 30 Aug 2005 09:17:09 +0000 (09:17 +0000)
NEWS
ext/date/php_date.c

diff --git a/NEWS b/NEWS
index 6b1d9cc5c954fc059f38e48e15f52a884b8f654c..8d4871bcddbe2c708b0aec0a2117311b27ba25e1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ PHP                                                                        NEWS
 - Fixed "make test" to work for phpized extensions. (Hartmut, Jani)
 - Fixed failing queries (FALSE returned) with mysqli_query() on 64 bit systems.
   (Andrey)
+- Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9).
+  (Derick)
 - Fixed bug #34299 (ReflectionClass::isInstantiable() returns true for abstract
   classes). (Marcus)
 - Fixed bug #34284 (CLI phpinfo showing html on _SERVER["argv"]). (Jani)
index 16e6ce806de87db24e370d0a744268e9453d7dbd..05eb26f58836f3c70cec65d46672a34ae18b8291 100644 (file)
@@ -392,7 +392,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca
                        case 'z': snprintf(buffer, 32, "%d", (int) timelib_day_of_year(t->y, t->m, t->d)); break;
 
                        /* week */
-                       case 'W': snprintf(buffer, 32, "%d", (int) isoweek); break; /* iso weeknr */
+                       case 'W': snprintf(buffer, 32, "%02d", (int) isoweek); break; /* iso weeknr */
                        case 'o': snprintf(buffer, 32, "%d", (int) isoyear); break; /* iso year */
 
                        /* month */