1$s = '06/10/2011 19:00:02';
2$date = strtotime($s);
3echo date('d/M/Y H:i:s', $date);
4The above one is the one of the example of converting a string to date.
5echo $s ->format('Y-m-d');
6The above one is another method
1$s = '06/10/2011 19:00:02';
2$date = strtotime($s);
3echo date('d/M/Y H:i:s', $date);
1$element = '15-Feb-2009';
2$date = DateTime::createFromFormat('j-M-Y', $element);
1Date to string
2
3$date = "2021/03/13";
4$newdate= date('d M, Y', strtotime($date));
5echo $newdate;
1$s = '06/10/2011 19:00:02';$date = strtotime($s);echo date('d/M/Y H:i:s', $date); The above one is the one of the example of converting a string to date. echo $s ->format('Y-m-d'); The above one is another method