Bug #69806 [NEW]: Incorrect date from timestamp

From: Date: Fri, 12 Jun 2015 01:37:43 +0000
Subject: Bug #69806 [NEW]: Incorrect date from timestamp
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193351@lists.php.net to get a copy of this message
From: ryan dot brothers at gmail dot com Operating system: Linux PHP version: 5.6.10 Package: Date/time related Bug Type: Bug Bug description:Incorrect date from timestamp Description: ------------ I am seeing an issue where PHP's date() function is returning a different date/time compared to the linux date command for certain dates. In the below example, I was expecting the 2 dates to be the same. It possibly looks to be related to Daylight Saving Time not being included by the date() function for this date. Test script: --------------- <?php ini_set('date.timezone', 'America/New_York'); echo date('Y-m-d H:i:s', 2377224000)."\n"; echo `TZ=America/New_York date --date='@2377224000' "+%Y-%m-%d %H:%M:%S"`."\n"; exit; Expected result: ---------------- 2045-05-01 00:00:00 2045-05-01 00:00:00 Actual result: -------------- 2045-04-30 23:00:00 2045-05-01 00:00:00 -- Edit bug report at https://bugs.php.net/bug.php?id=69806&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69806&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69806&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69806&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69806&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69806&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69806&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69806&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69806&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69806&r=support Expected behavior: https://bugs.php.net/fix.php?id=69806&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69806&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69806&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69806&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69806&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69806&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69806&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69806&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69806&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69806&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69806&r=mysqlcfg

« previous php.bugs (#193351) next »