]> 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:56 +0000 (09:17 +0000)
committerDerick Rethans <derick@php.net>
Tue, 30 Aug 2005 09:17:56 +0000 (09:17 +0000)
NEWS
ext/date/php_date.c

diff --git a/NEWS b/NEWS
index 68f740f35c9702f3c2e81b3791e8fb7c664b3809..ee58a55df749661867d6971d2a679d0a9cd6e3c0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -13,3 +13,5 @@ PHP                                                                        NEWS
   the part of haystack before or after first occurence of needle. (Johannes)
 - Fixed a bug where stream_get_meta_data() did not return the "uri" element for
   files opened with tmpname(). (Derick)
+- Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9).
+  (Derick)
index 6c32a47f1c2e06505bf2e9bbe9ace8350b7d9cc3..9a0421be397a27d097370df2be10b7d261a44bec 100644 (file)
@@ -492,7 +492,7 @@ static char *date_format(char *format, int format_len, int *return_len, timelib_
                        case 'z': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) timelib_day_of_year(t->y, t->m, t->d)); break;
 
                        /* week */
-                       case 'W': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) isoweek); break; /* iso weeknr */
+                       case 'W': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%0d", (int) isoweek); break; /* iso weeknr */
                        case 'o': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", (int) isoyear); break; /* iso year */
 
                        /* month */