PHP DateTime __construct() Failed to parse time string (xxxxxxxx) at position x

后端 未结 5 1937

I had this construction error when trying to creating a new DateTime object using a timestamp:

Exception: DateTime::_construct(): Failed to parse

5条回答
  •  醉话见心
    2020-12-24 11:19

    $start_date = new DateTime();
    $start_date->setTimestamp($dbResult->db_timestamp);
    

提交回复
热议问题