Hello i have date format d/m/Y and i like to change it to Y-m-d. i use this code:
$check_in = '31/12/2014';
$check_out = '2/01/2015';
$md = explode("/", $check_in); // split the array
$nd = $md[2]."-".$md[1]."-".$md[0]; // join them together
$check_in_new = date('Y-m-d', strtotime($nd));
$mmd = explode("/", $check_out); // split the array
$nnd = $md[2]."-".$mmd[1]."-".$mmd[0]; // join them together
$check_out_new = date('Y-m-d', strtotime($nnd));
and its work fine, but if i try to convert 02/01/2015 (year 2015) the result is 2014-01-02 its convert the year to 2014
any help???