2011年1月18日 星期二

[php] xsd:dateTime 格式轉換

2011-01-18T16:00:00.000Z這什麼鬼格式啊~  ISO-8601格式
請參考這邊


$t = '2011-01-18T16:00:00.000Z';
echo date('Y-m-d H:i:s',  strtotime($t)+ 3600*8 )  ; // 台北+8小時

【下列文章您可能也有興趣】

2 則留言:

Jax Hu 提到...

你可以先設定 PHP 的時區
ini_set('date.timezone',"Asia/Taipei")
這樣 strtotime 就會自動判斷了

還有這是 ISO-8601 最完整的格式

千江有水千江月 提到...

感謝大大提醒~