ZF-10876: Any date higher then 2038 becomes invalid
Description
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)
Comments
Posted by Arend de Boer (arenddeboer) on 2010-12-29T02:11:06.000+0000
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.
Posted by Adam Lundrigan (adamlundrigan) on 2011-06-14T01:38:40.000+0000
Fixed in trunk r24137 Merged to release in r24138
Posted by Arend de Boer (arenddeboer) on 2011-06-14T06:37:55.000+0000
Thanks Adam. It's great to see someone picking things up again!