php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37137 mktime 2006-10-15 bug
Submitted: 2006-04-19 19:29 UTC Modified: 2006-04-19 19:36 UTC
From: eyglys at yahoo dot com dot br Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.1.2 OS: Linux
Private report: No CVE-ID: None
 [2006-04-19 19:29 UTC] eyglys at yahoo dot com dot br
Description:
------------
Using mktime to make date 2006-10-15 00:00:00 , produce 2006-10-15 01:00:00

Reproduce code:
---------------
<?
$date = mktime(0,0,0,10,15,2006);
echo date("Y-m-d H:i:s",$date);
?>

Expected result:
----------------
2006-10-15 00:00:00

Actual result:
--------------
2006-10-15 01:00:00

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-19 19:33 UTC] derick@php.net
Might not be a bug... what timezone are you in? (check phpinfo() output, the date section)
 [2006-04-19 19:36 UTC] derick@php.net
Probably America/Sao_Paulo, and for that timezone there is indeed no 00:00 on Sun 16 Oct 2006 as you switch to BRST from BST on this date. After Sat 15 oct 23:59:59 BRT the next second is Sun 16 oct 01:00:00 BRST:
America/Sao_Paulo  Sun Feb 20 02:00:00 2005 UTC = Sat Feb 19 23:00:00 2005 BRT isdst=0 gmtoff=-10800
America/Sao_Paulo  Sun Oct 16 02:59:59 2005 UTC = Sat Oct 15 23:59:59 2005 BRT isdst=0 gmtoff=-10800
America/Sao_Paulo  Sun Oct 16 03:00:00 2005 UTC = Sun Oct 16 01:00:00 2005 BRST isdst=1 gmtoff=-7200
America/Sao_Paulo  Sun Feb 19 01:59:59 2006 UTC = Sat Feb 18 23:59:59 2006 BRST isdst=1 gmtoff=-7200


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Apr 01 14:00:02 2026 UTC