php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51240 date / mktime gives different dates for same parameters
Submitted: 2010-03-08 19:25 UTC Modified: 2010-03-08 20:27 UTC
From: w-pfeiffer-tue at gmx dot de Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.13 OS: windows xp sp3
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: w-pfeiffer-tue at gmx dot de
New email:
PHP Version: OS:

 

 [2010-03-08 19:25 UTC] w-pfeiffer-tue at gmx dot de
Description:
------------
the date / mktime gives different dates although the parameters have the same value

Test script:
---------------
php -r "echo date('d.m.Y', mktime(0,0,0, 3,9,2010));"
> 09.03.2010
php -r "echo date('d.m.Y', mktime(0,0,0, 3, 09,2010));"
> 28.02.2010


Expected result:
----------------
php -r "echo date('d.m.Y', mktime(0,0,0, 3,9,2010));"
> 09.03.2010
php -r "echo date('d.m.Y', mktime(0,0,0, 3, 09,2010));"
> 28.02.2010


Actual result:
--------------
php -r "echo date('d.m.Y', mktime(0,0,0, 3,9,2010));"
> 09.03.2010
php -r "echo date('d.m.Y', mktime(0,0,0, 3, 09,2010));"
> 28.02.2010


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-08 19:46 UTC] derick@php.net
-Status: Open +Status: Bogus
 [2010-03-08 19:46 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

09 starts with 0, which is the start of an octal number. Octal number 09 is invalid so turned into 0.
 [2010-03-08 20:27 UTC] w-pfeiffer-tue at gmx dot de
thanks. :-)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 00:01:34 2025 UTC