Skip to content
Prodjex

PHP Date Formatting

1 min read

PHP Date Formatting

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;
  • date format
  • dateformat
  • php
  • strtotime

Keep reading