I'm trying to format a date in the form mm-dd-yyyy
to the form yyyy-mm-dd
, however, when I try formatting it, it comes out as 1969-12-31
.
Here's my code:
$custom_date = "10-13-2013";
$formatted_date = date("Y-m-d", strtotime($custom_date));
What's wrong?