ID:               46970
 Updated by:       [email protected]
 Reported By:      supratiksekhar at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         *Calendar problems
 Operating System: Windows
 PHP Version:      5.2.8
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

W displays the ISO week number, which is really 01 right now (of the
ISO year 2009).


Previous Comments:
------------------------------------------------------------------------

[2008-12-30 09:56:06] supratiksekhar at gmail dot com

Description:
------------
I am using php-5.2.6 currently, while writing a function to get week
number using date("W") I found that the value it is returning is wrong.
I searched for the solution and found that this is a bug [Bug #33957]
in PHP which is already being solved. But when I try for the year 2008
it returns the wrong value. I tried with the latest version of PHP but
the problem is still there.

Thanks

Supratik

Reproduce code:
---------------
$datestr = "2008-12-29  00:00:00";
$da = new DateTime($datestr);
$t = $da->format("U");
echo "Week number: " . date("W", $t);

Expected result:
----------------
Week number: 53

Actual result:
--------------
Week number: 01


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46970&edit=1

Reply via email to