开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜