drngnh708353 2015-07-08 21:37
浏览 40
已采纳

php - 无法从字符串转换日期

I want to get this date's timestamp from string. I'm trying:

DateTime::createFromFormat("Y-m-d", "2015-05-18T23:45:21.604Z");

But it returns nothing. I don't know which format is this.

  • 写回答

1条回答 默认 最新

  • dqst96444 2015-07-08 21:51
    关注

    try this,

    $date = date_create_from_format('d/M/Y:H:i:s', '2015-05-18T23:45:21.604Z');
    $date->getTimestamp();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?