note 108963 added to function.date
| From: | sander at rotorsolutions dot nl | Date: | Fri, 08 Jun 2012 12:36:17 +0000 |
| Subject: | note 108963 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188460@lists.php.net to get a copy of this message | ||
watch out with weeks
$iso = date('Y-\WW', strtotime('2010-12-31'));
echo($iso . '<br />');
echo('Year and week from iso: ' . date('Y-m-d', strtotime($iso)) . '<br
/>');
$iso = date('Y-\WW', strtotime('2011-01-01'));
echo($iso . '<br />');
echo('Year and week from iso: ' . date('Y-m-d', strtotime($iso)));
===== RESULT =====
2010-W52
Year and week from iso: 2010-12-27
2011-W52
Year and week from iso: 2011-12-26
Wich is incorrect it should be
2010-W52
Year and week from iso: 2010-12-27
2010-W52
Year and week from iso: 2010-12-27
----
Server IP: 91.199.167.223
Probable Submitter: 95.97.155.20
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/108963
Del: integrated -- https://master.php.net/note/delete/108963/integrated
Del: useless -- https://master.php.net/note/delete/108963/useless
Del: bad code -- https://master.php.net/note/delete/108963/bad+code
Del: spam -- https://master.php.net/note/delete/108963/spam
Del: non-english -- https://master.php.net/note/delete/108963/non-english
Del: in docs -- https://master.php.net/note/delete/108963/in+docs
Del: other reasons-- https://master.php.net/note/delete/108963
Reject -- https://master.php.net/note/reject/108963
Search -- https://master.php.net/manage/user-notes.php