Convert mssql datetime object to PHP string

后端 未结 9 798
春和景丽
春和景丽 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:12

    Try this. It works for me:

    $array['arrayItem']->format('Y-m-d H:i:s');
    

    Reference: http://php.net/manual/en/datetime.format.php

提交回复
热议问题