php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63580 1333152000 is incorrectly calculated at date()
Submitted: 2012-11-22 09:25 UTC Modified: 2012-11-23 07:59 UTC
From: me at ivangasparetto dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: me at ivangasparetto dot com
New email:
PHP Version: OS:

 

 [2012-11-22 09:25 UTC] me at ivangasparetto dot com
Description:
------------
Please access
http://www.4webhelp.net/us/timestamp.php?action=stamp&stamp=1333152000&timezone=0

The UNIX timestamp 1333152000 should translate to 31 March 2012 00:00:00

Test script:
---------------
echo date('d/m/y H:i:s', 1333152000);

Expected result:
----------------
31/03/12 00:00:00

Actual result:
--------------
31/03/12 02:00:00

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-23 01:46 UTC] aharvey@php.net
-Status: Open +Status: Not a bug
 [2012-11-23 01:46 UTC] aharvey@php.net
That timestamp is only midnight in UTC. Chances are that your PHP setup is configured to operate in a different time zone (check the date.timezone configuration setting in phpinfo()).
 [2012-11-23 07:59 UTC] me at ivangasparetto dot com
Sorry, you are right.
echo date('d/m/Y H:i:s I O', 1333152000); // 31/03/2012 02:00:00 1 +0200
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 22:01:28 2024 UTC