note 53519 added to function.date
| From: | justin at drunkatgt dot com | Date: | Sat, 04 Jun 2005 15:24:06 +0000 |
| Subject: | note 53519 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89918@lists.php.net to get a copy of this message | ||
In response to pmcdevitt(at)cesales.com:
If you just want to find out what last month was, try
$lastmonth=mktime(0,0,0,date("m")-1,1,date("Y"));
$lastmonth= date("M", $lastmonth);
There is no reason to use the day of the month to determine the revious month. And every month has
a 1st. You could even through an arbitrary year in there to save a fraction of a calculation.
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53519
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53519&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53519&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53519&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53519&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53519&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53519&report=yes
Search -- http://master.php.net/manage/user-notes.php