php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50344 Incorrect Month Returned
Submitted: 2009-11-30 22:44 UTC Modified: 2009-11-30 22:48 UTC
From: info at demonwares dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.1 OS: lynix
Private report: No CVE-ID: None
 [2009-11-30 22:44 UTC] info at demonwares dot com
Description:
------------
Code returns the wrong month name

Reproduce code:
---------------
date( 'F', mktime(0, 0, 0, 2) )

Expected result:
----------------
This should return February

Actual result:
--------------
This returns March

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-30 22:48 UTC] jani@php.net
# php -n -d date.timezone="Europe/Helsinki"  -r 'echo date("F", mktime(0, 0, 0, 2) ), "\n";'
February

It does return february. But if you omit the day/year, then mktime() uses the current day/year. RTFM: http://php.net/mktime
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Dec 04 19:00:01 2025 UTC