Skip to main content

A simple example of how to take a date and change it’s format using PHP.

August, 3 2015

to

YYYY-MM-DD

Easily done with the below code:

$old_date = 'August 3, 2015';

$new_date = date('Y-m-d', strtotime($old_date) );

echo $new_date;

Leave a Reply