2020-11-04 10:09:02
•
941
php格式化时间格式
php格式化时间格式:
echo gmdate('Y-m-d\TH:i:s',time()).'+08:00'; echo '<br>'; echo str_replace('+00:00', '.000Z', gmdate('c', strtotime('2019-03-05 18:56:57'))); echo '<br>'; echo str_replace('+00:00', 'Z', gmdate('c')); echo '<br>';echo '<br>'; $date = "2020-11-04T01:53:06+08:00"; $offset=16*60*60; //converting 8 hours to seconds. $time = strtotime($date); // 转换为时间戳 echo date("Y-m-d H:i:s", $time+$offset); echo '<br>'; echo gmdate("Y-m-d H:i:s", $time);
php格式化时间格式仅供参考