note 58395 deleted from function.date by tularis
| From: | tularis@php.net | Date: | Thu, 09 Feb 2012 21:06:40 +0000 |
| Subject: | note 58395 deleted from function.date by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-186037@lists.php.net to get a copy of this message | ||
Note Submitter: vernon at vernonkesner dot com
----
The examples for getting a date in the past or future is simply not the best way to do it.
Especially if you are doing it dynamically.
I find the best way to get a date in the past or future is like this:
<?php
//get timestamp for past/future date I want
$pf_time = strtotime("-3 days");
//format the date using the timestamp generated
$pf_date = date("Y-m-d", $pf_time);
?>