开发者

Convert date time string in PHP

开发者 https://www.devze.com 2023-01-20 12:07 出处:网络
I have a Date/Time string from facebook graph that i need to convert to a read开发者_JAVA技巧able date time.

I have a Date/Time string from facebook graph that i need to convert to a read开发者_JAVA技巧able date time.

2010-09-17T04:07:36+0000

How can I format it to GMT+8 using php to look like this below.

17 September at 12:07


echo date('j F \a\t H:i', strtotime('2010-09-17T04:07:36+0000'));

References: date, strtotime

Set your timezone with date_default_timezone_set for correct conversion.


You can also get Date object using

$date_object = date_create('2010-09-17T04:07:36+0000');

0

精彩评论

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