This is my code and the output is right after that...

$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;
$PDate = $PDate->date;
echo "<h1>[", $PDate , "]</h1>";
echo "<h1>[", var_dump($row['PDate']) , "]</h1>";
echo "<h1>[", serialize($row['PDate']) , "]</h1><hr>";
the output is as follows. And my question is embedded in the output.

[]      ??? 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" } ]


if I were to directly insert the $row['date']  ms-sql value into mysq,
I get this error;
Catchable fatal error: Object of class DateTime could not be converted
to string in ....sql.php on line 379

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to