ZF-4537: Zend_Date returning wrong current date!
Zend_Date is returning the wrong date when creating a new object with no parameters.
Example: $logDate = new Zend_Date($dateStr, "YYYY-MM-DD HH:mm"); $curDate = new Zend_Date(); echo "Log: $logDate\n"; echo "Cur: " . $curDate . "\n"; echo "Time: " . gmdate("Y-m-d\TH:i:s.000\Z", time()) . "\n";
I get the following output: Log: Oct 9, 2008 2:28:00 PM Cur: Dec 31, 1969 7:28:05 PM Time: 2008-10-09T18:56:05.000Z
So Zend_Date() is returning a 1969 date, while time() is returning the correct date. Zend_Date's documentation claims that it uses the time() function to get the correct date, so the issue must lie within Zend_Date. The wierd thing is that Zend_Date works for the first call, when it is assigned into $logDate, it is only after the second call when it is assigned into $curDate that it gives the incorrect date.