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'));
精彩评论