How to convert "2011-02-14 16:14:57" into DD/MM/YYYY format in PHP?
I have a task to display the date in DD/MM/YYYY form开发者_开发技巧at, But I Have date stored as "2011-02-14 16:14:57" format, hence how can i convert it to get the DD/MM/YYYY in PHP?
echo date("d/m/Y", strtotime("2011-02-14 16:14:57"));
If you want more ways to do it, see PHP datetime extension.
Check this
Convert to date format dd/mm/yyyy
$n = "2011-02-14 16:14:57";
echo $time_output=date("d/m/Y",strtotime($n));
精彩评论