<?php
// entrada com MÊS / DIA / ANO
$date1 = DateTime::createFromFormat('m/d/Y', '11/12/2014');
echo $date1->format('Y-m-d').PHP_EOL; // Output: 2014-11-12
// entrada com DIA / MÊS / ANO
$date2 = DateTime::createFromFormat('d/m/Y', '31/10/2014');
echo $date2->format('Y-m-d').PHP_EOL; // Output: 2014-10-31
PD9waHAKCi8vIGVudHJhZGEgY29tIE3DilMgLyBESUEgLyBBTk8KJGRhdGUxID0gRGF0ZVRpbWU6OmNyZWF0ZUZyb21Gb3JtYXQoJ20vZC9ZJywgJzExLzEyLzIwMTQnKTsKCmVjaG8gJGRhdGUxLT5mb3JtYXQoJ1ktbS1kJykuUEhQX0VPTDsgICAgLy8gT3V0cHV0OiAyMDE0LTExLTEyCgovLyBlbnRyYWRhIGNvbSBESUEgLyBNw4pTIC8gQU5PCiRkYXRlMiA9IERhdGVUaW1lOjpjcmVhdGVGcm9tRm9ybWF0KCdkL20vWScsICczMS8xMC8yMDE0Jyk7CmVjaG8gJGRhdGUyLT5mb3JtYXQoJ1ktbS1kJykuUEhQX0VPTDsgICAgLy8gT3V0cHV0OiAyMDE0LTEwLTMx