Click to See Complete Forum and Search --> : date manipulation


Beach Bum
09-18-2005, 11:18 PM
What is the most efficient way to get these same values for yesterday:

$year = date("y");
$month = date("m");
$day = date("d");

So you have the two digit month day year for yesterday.

Given there could be month and year changes when you go back a day. There must be an esier way than a strng of calculations.

Beach Bum
09-19-2005, 12:40 AM
Got it:

$month = date("m",strtotime("-1 day"));
$day = date("d",strtotime("-1 day"));
$year = date("y",strtotime("-1 day"));