Convert date time string in PHP

后端 未结 2 1694
渐次进展
渐次进展 2021-01-25 12:17

I have a Date/Time string from facebook graph that i need to convert to a readable date time.

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

How can I format it to GMT+8 using php to

相关标签:
2条回答
  • 2021-01-25 13:03
    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.

    0 讨论(0)
  • 2021-01-25 13:09

    You can also get Date object using

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

    0 讨论(0)
提交回复
热议问题