|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-01-07 09:06 UTC] tcheko at no-log dot org
Description:
------------
the test script returns date formated as year+week.
It should return a list of date like this:
...
201250
201251
201252
201301
201302
...
NB: increase $i if current weeknumber is greater than 14 to expose the bug.
Test script:
---------------
<?php
for($i = 15; $i >= 0; $i--) echo date("YW", strtotime("-$i week")) . "<br />";
?>
Expected result:
----------------
...
201250
201251
201252
201301
201302
...
Actual result:
--------------
...
201250
201251
201252
**201201**
201302
...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 22:00:01 2025 UTC |
Replace Y with o for expected year. Definitly subtle, misleading and brain damaged. for($i = 15; $i >= 0; $i--) echo date("oW", strtotime("-$i week")) . "<br />";