Convert mssql datetime object to PHP string

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

    Since its an object, you can't get the properties like you do with an array. You need the -> sign for accessing the date. In your question it seems as if you var_dumped the variable $arrayItem, so, use it like this:

    $date = strtotime($array['arrayItem']->date]);
    

提交回复
热议问题