note 33926 deleted from function.date by vincent
| From: | vincent@php.net | Date: | Fri, 12 Sep 2003 07:38:19 +0000 |
| Subject: | note 33926 deleted from function.date by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56351@lists.php.net to get a copy of this message | ||
Note Submitter: Alper SARI
----
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 :)