Edit report at http://bugs.php.net/bug.php?id=52062&edit=1

 ID:               52062
 Updated by:       fel...@php.net
 Reported by:      dan at bnet dot lt
 Summary:          large timestamps with DateTime::getTimestamp and
                   DateTime::setTimestamp
-Status:           Open
+Status:           Assigned
 Type:             Bug
 Package:          Date/time related
 Operating System: Ubuntu i686 2.6.32-22-generic
 PHP Version:      5.3.2
-Assigned To:      
+Assigned To:      derick



Previous Comments:
------------------------------------------------------------------------
[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 http://bugs.php.net/bug.php?id=52062&edit=1

Reply via email to