|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69806 Incorrect date from timestamp
Submitted: 2015-06-12 01:37 UTC Modified: 2021-04-06 19:53 UTC
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: ryan dot brothers at gmail dot com Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.6.10 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ryan dot brothers at gmail dot com
New email:
PHP Version: OS:


 [2015-06-12 01:37 UTC] ryan dot brothers at gmail dot com
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:
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";


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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-06 19:53 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: derick
 [2021-04-06 19:53 UTC]
The fix for this bug has been committed.
If you are still experiencing this bug, try to check out latest source from and re-test.
Thank you for the report, and for helping us make PHP better.

Fixed for PHP 8.1.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 11:01:25 2023 UTC