Convert mssql datetime object to PHP string

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

    It is functionality and simple to use.

    You can convert date from date object instead of string here is the way how to use:

    $obj->arrayItem->format('H:i:s')
    $obj->arrayItem->format('Y-m-d')
    

提交回复
热议问题