Bug #52062 [Csd->Asn]: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp
| From: | stas@php.net | Date: | Mon, 26 Dec 2011 00:03:56 +0000 |
| Subject: | Bug #52062 [Csd->Asn]: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-166085@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=52062&edit=1
ID: 52062
Updated by: stas@php.net
Reported by: dan at bnet dot lt
Summary: large timestamps with DateTime::getTimestamp and
DateTime::setTimestamp
-Status: Closed
+Status: Assigned
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:
Still reproduceable for me on Mac OS X in 32-bit mode. Test for bug 52062 fails.
Previous Comments:
------------------------------------------------------------------------
[2011-12-06 06:20:53] derick@php.net
Automatic comment from SVN on behalf of derick
Revision: http://svn.php.net/viewvc/?view=revision&revision=320481
Log: - Fixed bug #53502 (strtotime with timezone memory leak).
- Fixed bug #52062 (large timestamps with DateTime::getTimestamp and
DateTime::setTimestamp).
- Fixed bug #51994 (date_parse_from_format is parsing invalid date using 'yz'
format).
- Fixed bug #51223 (Seg fault while creating (by unserialization)
DatePeriod).
------------------------------------------------------------------------
[2011-12-06 06:04:14] derick@php.net
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.
------------------------------------------------------------------------
[2011-12-06 06:04:07] derick@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