I’m able to get yesterday’s date by subtracting one day of off today’s date:
Something like:
Code:
$year = date(“Y”);
$month = date(“m”);
$day = date(“d”);
$dayminusone = $day - 1;
But what happens if today is February 1st…how do you get it to realize that 1 minus 1 would end up with 0 and that it should be Jan. 31st…or what about on March 1st when February only has 28 days and it needs to realize that it should go back to Feb 28th as the previous day?
Any thoughts?
Thanks.