I have this code:
$date = substr($item[8], 7, 9);
$date = str_replace('/', '-', $date);
At this point, $date contains:
12-21-12 <---- December 21, 2012
Now I am trying to output date into a input type="date" friendly format as such:
<input type="date" name="date" value="<?php echo date('Y-m-d', strtotime($date)); ?>">
But it won't output properly.
If I change type="date" to type="text" I see the following output:
1969-12-31
Clearly something isn't working right in
date('m-d-Y', strtotime($date));
Can anyone help me clear up the problem?