1 2 3 4 5 |
$date = "26/10/1986"; $date = str_replace('/', '-', $date); $date = date('Y-m-d H:i:s', strtotime($date)); |
output: 1986-10-26 00:00:00
Or this…
1 2 3 4 |
$date = str_replace('-', '/', $hiredate[$key]); $date = date('d/m/Y g:ia', strtotime($date)); |