note 85332 added to function.date
| From: | pdubbb1 at gmail dot com | Date: | Tue, 26 Aug 2008 12:32:23 +0000 |
| Subject: | note 85332 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143831@lists.php.net to get a copy of this message | ||
here is the simpliest way to get the start and end date of the week;
$sdate=date('c',strtotime(date('Y')."W".date('W')."0"));
$edate=date('c',strtotime(date('Y')."W".date('W')."7"));
the format is for the string in strtotime is;
2008W200
this stands for year - 2008, constant never changes - W, week number of the year - 20, day of the
week - 0 for sunday, 1 for monday, etc....
so 2008W200 stands for the sunday of the 20th week of 2008.
This will only work in php 5 or better
----
Server IP: 64.71.164.2
Probable Submitter: 24.90.240.208
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/85332
Del: integrated -- https://master.php.net/note/delete/85332/integrated
Del: useless -- https://master.php.net/note/delete/85332/useless
Del: bad code -- https://master.php.net/note/delete/85332/bad+code
Del: spam -- https://master.php.net/note/delete/85332/spam
Del: non-english -- https://master.php.net/note/delete/85332/non-english
Del: in docs -- https://master.php.net/note/delete/85332/in+docs
Del: other reasons-- https://master.php.net/note/delete/85332
Reject -- https://master.php.net/note/reject/85332
Search -- https://master.php.net/manage/user-notes.php