Submitted by Kiran on Wed, 08/12/2009 - 12:38
Suppose I have a date coming in, "2009-01-01", what is the correct ways to decrement the date so that it will be just one day smaller.
»
- 616 reads
Kiran - LAMP ExpertLAMP my de facto development standard. |
Suppose I have a date coming in, "2009-01-01", what is the correct ways to decrement the date so that it will be just one day smaller.
I love work environment which is:
Travelling Sucks
Here is another way out for decrementing days
$date = strtotime("-1 day", strtotime("2009-01-01"));
echo date("Y-m-d", $date);
//let's
$today="2009-01-01";
//then
$previousday=strftime("%Y-%m-%d", strtotime("$today -1 day"));
Post new comment