Re: Date() finding yesterday
| From: | Rabin Vincent | Date: | Sun, 21 May 2006 04:50:37 +0000 |
| Subject: | Re: Date() finding yesterday | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236562@lists.php.net to get a copy of this message | ||
On 5/21/06, John Taylor-Johnston
<John.Taylor-Johnston@cegepsherbrooke.qc.ca> wrote:
I cannot seem to get this right. How can I produce yesterday? $today = date("Y-m-d"); $yesterday = date("Y-m-") . date("d")-1; $yesterday = date("Y-m-d")-1; $yesterday = date("Y-m-"."d"-1); I've been looking at the manual :) ...Use php.net/strtotime: $yesterday = date('Y-m-d', strtotime('-1 day')); Rabin -- http://rab.in