Categories
php programming Quick Tips

Get past date or convert different date format with php

Quick way to figure out a past date in PHP.

echo date("Y-m-d", strtotime("20 days ago"));
echo date('Y-m-d',strtotime('12/15/2008'));

By Adam

Speaker, author, consultant, OSS contributor, SoFloPHP UG and SunshinePHP Conf organizer, RunGeekRadio Host, Long distance runner and ultra marathoner.