Convert mssql datetime object to PHP string

后端 未结 9 583
春和景丽
春和景丽 2021-02-05 12:41

I\'m grabbing some information from a database and the record is in an MSSQL DateTime format, when I return it, it shows in my array as follows:

[arrayItem] =>         


        
9条回答
  •  暖寄归人
    2021-02-05 13:15

    Another solution is to loop.

    $_date = \DateTime::createFromFormat('D M d Y H:i:s e+', $the_date);
    foreach($_dateStart as $row){
       echo $row; // returns 2014-06-04 15:00
       break;     // stops at the first position
    }
    

提交回复
热议问题