|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-12-30 10:36 UTC] derick@php.net
[2008-12-30 12:00 UTC] supratiksekhar at gmail dot com
[2008-12-30 12:22 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 02:00:01 2025 UTC |
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