ZF-10876: Any date higher then 2038 becomes invalid


Receiving a Date object with a date higher then 2038 results in an invalid date. It seems to go wrong in Zend/Amf/Parse/Deserializer.php, function readDate() Either changing line 225: $timestamp = floor($this->_stream->readDouble() / 1000); to: $timestamp = sprintf('%u',$this->_stream->readDouble()/1000); Or changing line 228: $dateTime = new Zend_Date((int) $timestamp); to: $dateTime = new Zend_Date($timestamp); Solves the problem. The latter probably being the best solution.

Using: PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:41:55)


On a side note, this was discovered on a 32 bit environment. As expected, casting the timestamp to a 64 bit integer on a 64 bits system does not yield this error.

Fixed in trunk r24137 Merged to release in r24138

Thanks Adam. It's great to see someone picking things up again!