Bug #18532 Updated: date('W'...) returns wrong weeknumbers
| From: | georg@php.net | Date: | Wed, 24 Jul 2002 16:36:19 +0000 |
| Subject: | Bug #18532 Updated: date('W'...) returns wrong weeknumbers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-15061@lists.php.net to get a copy of this message | ||
ID: 18532
Updated by: georg@php.net
Reported By: tmus@get2net.dk
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux / Windows XP
PHP Version: 4.2.1
New Comment:
date uses iso8601 standard which supports long years (53 weeks).
the first week of the ISO calendar year can begin as late as 4 January
and as early as 29 December of the previous year. Likewise, the last
week of the ISO calendar year can end as early as 28 December and as
late as 3 January of the following year.
Previous Comments:
------------------------------------------------------------------------
[2002-07-24 05:07:50] tmus@get2net.dk
There is a problem with the date('W'...) function in PHP 4.2.1...
The ISO standard says that week 1 is the week that has the first
thursday of the gregorian year, making the last week the week with the
last thursday of the year (more/better info here
http://www.merlyn.demon.co.uk/weekinfo.htm#WkNo
)
But anyway, try making the following test...
print date("r (W)",1041289200)."<br>\n"; // Tue, 31 Dec 2002 00:00:00
+0100 (53)
print date("r (W)",1041375600)."<br>\n"; // Wed, 1 Jan 2003 00:00:00
+0100 (1)
So any way You decide to put it, at least the same week should not
have
two different numbers depending on the timestamp.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18532&edit=1