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
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.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 25 23:01:29 2024 UTC