Edit report at https://bugs.php.net/bug.php?id=52062&edit=1
ID: 52062 Updated by: der...@php.net Reported by: dan at bnet dot lt Summary: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp -Status: Assigned +Status: Closed Type: Bug Package: Date/time related Operating System: Ubuntu i686 2.6.32-22-generic PHP Version: 5.3.2 Assigned To: derick Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2011-12-06 06:04:07] der...@php.net Automatic comment from SVN on behalf of derick Revision: http://svn.php.net/viewvc/?view=revision&revision=320478 Log: - Fixed bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp. ------------------------------------------------------------------------ [2010-06-12 05:15:09] dan at bnet dot lt Description: ------------ DateTime::getTimestamp(), DateTime::setTimestamp() and DateInterval does not work with large timestamps (using numbers over x86 integers) Test script: --------------- $d = new DateTime('@100000000000'); var_dump($d->format('Y-m-d H:i:s U')); var_dump($d->getTimestamp()); $d->setTimestamp(100000000000); var_dump($d->format('Y-m-d H:i:s U')); var_dump($d->getTimestamp()); $i = new DateInterval('PT100000000000S'); var_dump($i->format('%s')); Expected result: ---------------- string(32) "5138-11-16 09:46:40 100000000000" float(100000000000) string(32) "5138-11-16 09:46:40 100000000000" float(100000000000) string(12) "100000000000" Actual result: -------------- string(32) "5138-11-16 09:46:40 100000000000" bool(false) string(30) "2008-07-11 04:56:32 1215752192" int(1215752192) Exception with message 'DateInterval::__construct(): Unknown or bad format (PT100000000000S)' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=52062&edit=1