Bug #18532: date('W'...) returns wrong weeknumbers

From: Date: Wed, 24 Jul 2002 09:07:50 +0000
Subject: Bug #18532: date('W'...) returns wrong weeknumbers
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15023@lists.php.net to get a copy of this message
From: tmus@get2net.dk Operating system: Linux / Windows XP PHP version: 4.2.1 PHP Bug Type: Date/time related Bug description: date('W'...) returns wrong weeknumbers 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 bug report at http://bugs.php.net/?id=18532&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18532&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18532&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18532&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18532&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18532&r=support Expected behavior: http://bugs.php.net/fix.php?id=18532&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18532&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18532&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18532&r=globals

« previous php.bugs (#15023) next »