php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30331 Function mktime returns wrong date
Submitted: 2004-10-05 20:53 UTC Modified: 2004-10-06 08:50 UTC
From: grumiche at powers dot com dot br Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.9 OS: AIX 5.1
Private report: No CVE-ID: None
 [2004-10-05 20:53 UTC] grumiche at powers dot com dot br
Description:
------------
Function mktime returns wrong date. 
Problem found when installing eGroupWare at AIX. 
Machine: IBM RISC 6000 e30  
OS: AIX 5.1 Maintenance Level 6 
PHP 4.3.9 
Apache 1.3.29-1 
Without changes on php.ini. 
Compiled modules: '/configure' 
'--with-apxs=/opt/freeware/apache/sbin/apxs' '--with-mysql' 
'--enable-trackvars' '--with-ldap' 
'--with-gettext=/opt/freeware' '--with-mbstring' 
'--with-pear' '--with-gd=/opt/freeware' 
'--with-zlib=/opt/freeware' 
'--with-freetype-dir=/opt/freeware' 
'--with-ttf=/opt/freeware' '--enable-mbstring' 
'--with-jpeg-dir=/opt/freeware' 
'--with-png-dir=/opt/freeware' 
'--with-zlib-dir=/opt/freeware' 
 
Same error apears on another installation: 
Machine: IBM RISC 6000 43P 
OS: AIX 5.1 Maintenance Level 3 
PHP 4.3.8 
Apache 1.3.29-1 
Without changes on php.ini. 
Compiled modules: 
'./configure' '--with-apxs=/opt/freeware/apache/sbin/apxs' 
'--with-mysql' '--enable-trackvars' '--with-ldap' 
'--with-gettext=/opt/freeware' '--with-mbstring' 
'--with-pear' '--with-openssl=/opt/freeware' 
'--with-gd=/opt/freeware' '--with-zlib=/opt/freeware' 
 

Reproduce code:
---------------
mktime(2,0,0,10,1 - (5 - 1), 2004,1) 


Expected result:
----------------
1096261200 

Actual result:
--------------
1096520400 
 

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-06 08:50 UTC] derick@php.net
Why is this wrong? You're using -3 as parameter... what's the point of that? The -3rd october is also sept. 27th which is what your mktime call resolves too:

php -r 'echo date("Y-m-d H:i:s", mktime(2,0,0,10,1 - (5 - 1), 2004,1));'
2004-09-27 02:00:00

No bug here -> bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Aug 15 17:01:28 2024 UTC