I think you might need:
echo date_format(date_create_from_format('m-d-Y', $row['B']), 'Y-m-d');
Y rather than y in the date_create_from_format() method
I think you might need:
echo date_format(date_create_from_format('m-d-Y', $row['B']), 'Y-m-d');
Y rather than y in the date_create_from_format() method