开发者

How to convert "2011-02-14 16:14:57" into DD/MM/YYYY format in PHP?

开发者 https://www.devze.com 2023-02-10 18:38 出处:网络
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

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));
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号