ID: 22984 Updated by: [EMAIL PROTECTED] Reported By: jeremyrimer at yahoo dot com Status: Bogus Bug Type: Date/time related Operating System: win2kadvsrv PHP Version: 4.3.1 New Comment:
Today (and you did submit this bug today) is 3/31/2003 Your calculation of 'next month' produces 4/31/2003 April only has 30 days.... See your problem? :) Previous Comments: ------------------------------------------------------------------------ [2003-03-31 14:20:16] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. I'm pretty sure this is NOT a bug.... ------------------------------------------------------------------------ [2003-03-31 11:05:57] jeremyrimer at yahoo dot com So I have some code that prints out this and next month's calendar and populates the cells with the day's events. Sometimes, and I can't find root cause except to say that there MUST be a bug in the date() function or the mktime() function because I have a line of code to produce NEXTmonth's month name in text, and it is producing the month TWO months later instead of 1, despite my +1 increment... $tyear = date("Y"); // the year - 4 digit $nyear = date("Y")+1; $tmonth = date("n"); // the month - no leading 0's $nmonth = date("n")+1; $tday = date("j"); // the day as a number date("F",mktime(0,0,0,$nmonth,$tday,$tyear)); This line can produce not the NEXT month, but TWO months later... Driving me crazy... -Jeremy ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22984&edit=1