note 33926 added to function.date
| From: | Alper at rack1 dot php dot net | Date: | Fri, 11 Jul 2003 08:28:03 +0000 |
| Subject: | note 33926 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51891@lists.php.net to get a copy of this message | ||
Countries that using monday of first day of week can be use this code. The code calculate first and
last dates of week by date.
$year = "2003";
$month = "07";
$day = "11";
$time_ = mktime(0,0,0,$month,$day,$year);
$hgunu_ = ((date('w',$time_) + 6) % 7);
$firstday_ = date("Y-m-d",$time_-$hgunu_*86400);
$lastday_ = date("Y-m-d",$time_+(6-$hgunu_)*86400);
echo $firstday_." / ".$lastday_;
This code can use in Turkey :)
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33926
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33926&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33926&report=yes