php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44177 Inconsistent unix time to date
Submitted: 2008-02-19 21:34 UTC Modified: 2008-02-19 21:36 UTC
From: huferry at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2CVS-2008-02-19 (snap) OS: Unix/Windows
Private report: No CVE-ID: None
 [2008-02-19 21:34 UTC] huferry at gmail dot com
Description:
------------
I have received a Unix time stamp from my database: 1208991600.
Using a phpMyAdmin it points to 24 April 2008. So does my local PHP show it (using Windows). 
On my web host (Linux), this time stamp is parsed by PHP as 23 April 2008.

An example of this script can be found at:

http://www.fmc-online.nl/unixtime.php5

If needed to check the phpinfo:

http://www.fmc-online.nl/info.php5

Reproduce code:
---------------
$ts = 1208991600;
echo "timestamp = $ts <br>";
echo "php date/time = ".date("d-m-Y", $ts);

Expected result:
----------------
timestamp = 1208991600
php date/time = 24-04-2008

Actual result:
--------------
timestamp = 1208991600
php date/time = 23-04-2008

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-19 21:36 UTC] rasmus@php.net
You have discovered timezones.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Aug 16 02:00:03 2025 UTC