开发者

Formatting the date 2011-09-23T23:00:00 to look like 23.09.11

开发者 https://www.devze.com 2023-03-31 21:26 出处:网络
I\'m hoping that this is a VERY simple question, but it\'s driving me insane! Date 开发者_高级运维formatting in PHP seems to require a timestamp, but all I have is 2011-09-23T23:00:00 and I\'d like t

I'm hoping that this is a VERY simple question, but it's driving me insane!

Date 开发者_高级运维formatting in PHP seems to require a timestamp, but all I have is 2011-09-23T23:00:00 and I'd like to turn that into 23.09.2011 - how do I do that?


Using DateTime / date_create:

date_create('2011-09-23T23:00:00')->format('d.m.Y');

Using strtotime:

date('d.m.Y', strtotime('2011-09-23T23:00:00'));
0

精彩评论

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