Re: DATE / strtotime

From: Date: Mon, 20 Apr 2009 03:27:57 +0000
Subject: Re: DATE / strtotime
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-291671@lists.php.net to get a copy of this message
Ron Piggott wrote:
Where $date_reference is 2009-04-18 the following code gives me a day of 1969-12-30. How do I get it to be 2009-04-17? $previous_date = strtotime("-1 days", $date_reference); $previous_date = date('Y-m-d', $previous_date);
Slightly wrong syntax. $previous_date = strtotime("$date_reference -1 days"); -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#291671) next »