note 14156 deleted from function.getdate by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 15 Sep 2004 16:37:33 +0000 |
| Subject: | note 14156 deleted from function.getdate by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76752@lists.php.net to get a copy of this message | ||
Note Submitter: canby23 at ms19 dot hinet dot net
----
Hi , all
I have a case ,must be know the week of first day ,so I wrote a easily code , maybe it would help
you to do something !!
$today_var = getdate();
$today_sec = mktime(0,0,0,date("m"),date("d"),date("Y"));
$offset = $today_var[wday] * 86400 ;
$first_day = $today_sec - $offset;
echo $this_week_first_date = date("Y-m-d", $first_day);
// yes , count the week of firstday !!
// by Vincent.hu