php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64316 function date not returning correct value for short int
Submitted: 2013-02-27 21:34 UTC Modified: 2013-02-27 21:48 UTC
From: ff at darkpenguin dot com dot br Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.22 OS: OpenSuse 12.1
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: ff at darkpenguin dot com dot br
New email:
PHP Version: OS:

 

 [2013-02-27 21:34 UTC] ff at darkpenguin dot com dot br
Description:
------------
---
From manual page: http://www.php.net/function.date#refsect1-function.date-description
---

Function date is not formatting time correctly when used with date_default_timezone_set and small integers.

Test script:
---------------
print date('H:i:s',24);

// this should and do print 00:00:24, but when I do this: 

date_default_timezone_set('America/Sao_Paulo');
print date('H:i:s',24);

// this prints 21:00:24


Expected result:
----------------
On the first "print date" I expect and get the result 00:00:24, on the second print I get 21:00:24 where I expected the same result before.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-27 21:48 UTC] rasmus@php.net
America/Sao_Paulo is not UTC so it couldn't possibly output 00:00:24
 [2013-02-27 21:48 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 12:01:33 2025 UTC