這是我的代碼,並在之後的輸出...日期轉換/ MSSQL> PHP之間提取問題>的MySQL
$PDate = $row['PDate'];
//row is tapping into ms-sql date field.
//and the ms-sql data field has a value like this for the PDate;
//07/12/2001
$PDate = $PDate->date;
echo "<h1>[", $PDate , "]</h1>";
echo "<h1>[", var_dump($row['PDate']) , "]</h1>";
echo "<h1>[", serialize($row['PDate']) , "]</h1><hr>";
輸出如下。我的問題嵌入在輸出中。
[] ??? WHY IS THIS BLANK? WHY IS THIS NOT 2001-12-07 00:00:00?
[object(DateTime)#3 (3) { ["date"]=> string(19) "2001-12-07 00:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } ]
[O:8:"DateTime":3:{s:4:"date";s:19:"2001-12-07 00:00:00";s:13:"timezone_type";i:3;s:8:"timezone";s:19:"America/Los_Angeles";}]
的字符串。 –