note 20570 deleted from function.strtotime by sniper
| From: | sniper@php.net | Date: | Tue, 21 Oct 2003 11:04:59 +0000 |
| Subject: | note 20570 deleted from function.strtotime by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59021@lists.php.net to get a copy of this message | ||
Note Submitter: nospam@domain.com
----
To find the first day of the week (e.g.: Sunday) for any given week, try this function.
function sundayOfWeek($year,$month,$day)
{
$linkDay = "$month/$day/$year";
$w = date("w", strtotime("$linkDay"));
$sow = date("Y-m-d", (strtotime("$linkDay")-$w*82800));
return $sow;
}
NOTE: In order to account for Daylight Savings Time (loosing or gaining an hour) I use 82800 seconds
instead of 86400 (60*60*7).