I have an input field for ‘birthday’ I’m using a javascript popup that returns the date in the following format “MM-DD’YYYY”, when I bring echo the value in the input field in my insert code, it displays properly, but when I use
$c_birthday = $_POST['dateBorn'];
$birth=date('Y.m.d',strtotime($c_birthday));
If I echo $c_birthday, it displays the value correctly such as “10-02-2012” but when I echo $birth, it shows 2012-02-10, it’s transposing the day and the month, I’ve tried using ‘Y-m-d’ and I get the same results.
Is there a setting I should be looking at?
FROM PHP DOC
To avoid potential
ambiguityas stated you can just use :