ID: 28581 Updated by: [EMAIL PROTECTED] Reported By: s_svene at hotmail dot com Status: Bogus Bug Type: Date/time related Operating System: Windows PHP Version: 5.0 New Comment:
When you don't feed mktime() a day, it uses the equivalent value from the current date. The original post was made on 30th May. Please check the documentation to see what mktime() makes of a request for 30th Feb. Definitely not a PHP bug. Previous Comments: ------------------------------------------------------------------------ [2004-05-30 20:51:18] [EMAIL PROTECTED] Btw, I was silly enough to do not have seen that: echo(date("m",mktime(0,0,0,3)."<br>"); should be: echo date("m<b\r>",mktime(0,0,0,3)); If you like to test it, use only mktime or: date('m', mktime(0,0,0,$m)); Bogus anyway, it works with both php5 and php4. --Pierre ------------------------------------------------------------------------ [2004-05-30 20:14:29] s_svene at hotmail dot com I have tried 5.0 to, and i can't get it to work.. going to try 4.6 to but. ------------------------------------------------------------------------ [2004-05-30 19:13:08] [EMAIL PROTECTED] Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Works here with 4.3.6 and snapshots (4 and 5, linux&win32) --Pierre ------------------------------------------------------------------------ [2004-05-30 17:49:59] s_svene at hotmail dot com Description: ------------ I have noticed a bug in the commando date("m",mktime(0,0,0,x); You get the same result if you type in a 2 or a 3 where X belong, that is the nuber of the current month. Reproduce code: --------------- <?php echo("Month 2 : "); echo(date("m",mktime(0,0,0,2)."<br>"); echo("Month 3"); echo(date("m",mktime(0,0,0,3)."<br>"); ?> Expected result: ---------------- Month 2 : 2 Month 3 : 3 Actual result: -------------- Month 2 : 3 Month 3 : 3 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28581&edit=1