From:
Operating system: Windows 7
PHP version: 5.3.3
Package: Date/time related
Bug Type: Bug
Bug description:Date since epoch is incorrect
Description:
------------
Checked the number of seconds since the epoch using the code shown in the
'Test
script' section below. There is a discrepancy when number of seconds =
10000000000 in that time goes backwards, i.e. 1973 to 2001 to 2014 to
2008.
Number of seconds since epoch = 1, date = 1 January 1970 01:00:01
Number of seconds since epoch = 10, date = 1 January 1970 01:00:10
Number of seconds since epoch = 100, date = 1 January 1970 01:01:40
Number of seconds since epoch = 1000, date = 1 January 1970 01:16:40
Number of seconds since epoch = 10000, date = 1 January 1970 03:46:40
Number of seconds since epoch = 100000, date = 2 January 1970 04:46:40
Number of seconds since epoch = 1000000, date = 12 January 1970 14:46:40
Number of seconds since epoch = 10000000, date = 26 April 1970 18:46:40
Number of seconds since epoch = 100000000, date = 3 March 1973 10:46:40
Number of seconds since epoch = 1000000000, date = 9 September 2001
03:46:40
Number of seconds since epoch = 10000000000, date = 7 September 2014
06:50:08
Number of seconds since epoch = 100000000000, date = 11 July 2008 06:56:32
Test script:
---------------
<?php
for ($i=0; $i<12; $i++) {
$numberOfSecondsSinceEpoch = pow(10,$i);
$date = date("j F Y H:i:s", $numberOfSecondsSinceEpoch);
echo "Number of seconds since epoch = $numberOfSecondsSinceEpoch, date
= $date <br />";
}
?>
--
Edit bug report at http://bugs.php.net/bug.php?id=53221&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53221&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53221&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53221&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53221&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53221&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53221&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53221&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53221&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53221&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53221&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53221&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53221&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53221&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53221&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53221&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53221&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53221&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53221&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53221&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53221&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53221&r=mysqlcfg