Q: 原始日期格式為:

2013-05-07 18:56:57 (yyyy-MM-dd hh:mm:ss)

要轉換成:

2013-05-07T18:56:57Z (yyyy-MM-ddThh:mm:ssZ)

的格式。

 

A: 

使用跳脫字元在date format中加入\T與\Z,再轉換一次即可。

 

 date("Y-m-d\TH:i:s.000\Z", strtotime("2013-05-07 18:56:57"));

 

--

參考 https://stackoverflow.com/questions/16516136/convert-date-to-t-z-format

arrow
arrow
    全站熱搜

    dizzy03 發表在 痞客邦 留言(0) 人氣()