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'));

Published by


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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.