#22984 [Opn->Bgs]: Date Function returning incorrect NAME of month

From: Date: Mon, 31 Mar 2003 20:20:17 +0000
Subject: #22984 [Opn->Bgs]: Date Function returning incorrect NAME of month
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-36845@lists.php.net to get a copy of this message
ID: 22984 Updated by: tularis@php.net Reported By: jeremyrimer at yahoo dot com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: win2kadvsrv PHP Version: 4.3.1 New Comment: 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.... Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#36845) next »