ID: 50879 User updated by: lehn at planet-ic dot de Reported By: lehn at planet-ic dot de Status: Bogus Bug Type: Date/time related Operating System: Linux PHP Version: 5.2.12 New Comment:
Thank you for your fast reply. I looked the manual twice before but i overlooked the default value of '$day = date("j")'. This kind of problems only happen in the last few days of a month, maybe a eye catching warning on the manual will help. Previous Comments: ------------------------------------------------------------------------ [2010-01-29 12:51:24] ahar...@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 If the day parameter is omitted when calling mktime(), the current day is used. Since today is the 29th of January, and February only has 28 days this year, this effectively results in the first call being mktime(0, 0, 0, 2, 29), and Feburary 29 is implicitly converted to March 1. ------------------------------------------------------------------------ [2010-01-29 11:16:14] lehn at planet-ic dot de Description: ------------ mktime produces wrong month for february if no day parameter given. Reproduce code: --------------- echo strftime("%B(%m)\n",mktime(0,0,0,2)); echo strftime("%B(%m)\n",mktime(0,0,0,2,1)); Expected result: ---------------- February(02) February(02) Actual result: -------------- March(03) February(02) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50879&edit=1