note 70556 added to function.date
| From: | khamir at mail dot ru | Date: | Fri, 20 Oct 2006 11:10:00 +0000 |
| Subject: | note 70556 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118835@lists.php.net to get a copy of this message | ||
How to calculate first day of current week:
<?php
$time = time();
$current_time =
mktime(0,0,0,date('m',$time),date('d',$time),date('Y',$time));
// This is a week begin time mark
// if week starts from monday
$week_begin_time = $current_time-(date(w,$time)-1)*24*60*60;
// if week starts from sunday
$week_begin_time = $current_time-date(w,$time)*24*60*60;
?>
----
Server IP: 195.54.192.44
Probable Submitter: 87.245.160.90
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/70556
Del: integrated -- https://master.php.net/note/delete/70556/integrated
Del: useless -- https://master.php.net/note/delete/70556/useless
Del: bad code -- https://master.php.net/note/delete/70556/bad+code
Del: spam -- https://master.php.net/note/delete/70556/spam
Del: non-english -- https://master.php.net/note/delete/70556/non-english
Del: in docs -- https://master.php.net/note/delete/70556/in+docs
Del: other reasons-- https://master.php.net/note/delete/70556
Reject -- https://master.php.net/note/reject/70556
Search -- https://master.php.net/manage/user-notes.php