note 39064 deleted from function.date by derick

From: Date: Sat, 22 May 2004 13:55:18 +0000
Subject: note 39064 deleted from function.date by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-69957@lists.php.net to get a copy of this message
Note Submitter: stratzsfear@apparitiondesigns.com ---- 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.

« previous php.notes (#69957) next »