note 32287 added to function.mktime
| From: | admin at jamuk dot com | Date: | Thu, 22 May 2003 15:35:45 +0000 |
| Subject: | note 32287 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-48826@lists.php.net to get a copy of this message | ||
A one line way to find the timestamp of the beginning of the previous Monday:
mktime( 0, 0 ,0 ,date("m"), date("d")+(((date("w")==0) ? -7 :
(-1*date("w"))) + 1), date("Y") ) ;
Very handy for business reporting, especially when used in conjunction with date().
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32287
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32287&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32287&report=yes