note 39064 added to function.date
| From: | stratzsfear at apparitiondesigns dot com | Date: | Thu, 15 Jan 2004 18:59:20 +0000 |
| Subject: | note 39064 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63644@lists.php.net to get a copy of this message | ||
Beginners looking into how to find dates in the future and past should note the following:
In the example:
<?php
$tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
$lastmonth = mktime(0, 0, 0, date("m")-1, date("d"), date("Y"));
$nextyear = mktime(0, 0, 0, date("m"), date("d"), date("Y")+1);
?>
this generates a timestamp. To display the date in a way that makes sense to you, you need to then
go:
<?php
$date = date("m d Y", $lastmonth)
?>
or put whatever variable you want for different time stamps.
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39064
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39064&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39064&report=yes
Search -- http://master.php.net/manage/user-notes.php