Another version to create new time format is here
Convert to any format
1 2 3 4 |
$mydate="Feb 12 1998 12:00AM"; echo date('d/m/Y', strtotime($mydate)); |
Reverse timestamp format, this will just show ’27-02-2015′.
1 2 3 4 5 |
$joindate = "2015-02-27 14:05:24" $joindate = date('d-m-Y H.i.s', strtotime($joindate)); $joindate = substr($joindate,0,10); |
This outputs 2013-07-12
1 2 3 4 5 6 7 |
$dates= "12/07/13"; $dates = mysql_real_escape_string($_POST['dates']); $dates = DateTime::createFromFormat('d/m/Y', $dates); echo $dates = $dates->format('Y-m-d'); |
If this does not work for you try this!
1 2 3 4 5 |
$time =explode("-","12-04-2008"); krsort($time); print "<p>".implode("/",$time)."</p>"; |