note 88813 added to function.date
| From: | simonjatg at osu1 dot php dot net | Date: | Mon, 09 Feb 2009 11:38:13 +0000 |
| Subject: | note 88813 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-150410@lists.php.net to get a copy of this message | ||
Don't assume the first week will always be at the start of the year.
The "W" (week of the year) will wrap at 52 back to one for the last couple of days.
$period = "D W Y";
$date1 = "28-DEC-08";
$date2 = "29-DEC-08";
echo date($period,strtotime($date1));
echo date($period,strtotime($date2));
gives:
"Sun 52 2008"
"Mon 01 2008"
----
Server IP: 209.41.74.194
Probable Submitter: 160.83.57.33
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/88813
Del: integrated -- https://master.php.net/note/delete/88813/integrated
Del: useless -- https://master.php.net/note/delete/88813/useless
Del: bad code -- https://master.php.net/note/delete/88813/bad+code
Del: spam -- https://master.php.net/note/delete/88813/spam
Del: non-english -- https://master.php.net/note/delete/88813/non-english
Del: in docs -- https://master.php.net/note/delete/88813/in+docs
Del: other reasons-- https://master.php.net/note/delete/88813
Reject -- https://master.php.net/note/reject/88813
Search -- https://master.php.net/manage/user-notes.php