Labels

Thursday, April 29, 2010

PHP: Get Yesterday's Date

echo date("Y-m-d", strtotime("-1 day") );

For some specific date:
echo date("Y-m-d", strtotime("2010-Jan-1 -1 day") );


Play around with this function to get your desired results. The PHP date parser is very smart.

0 comments:

Post a Comment