ID: 22957 Updated by: [EMAIL PROTECTED] Reported By: jacques dot daguerre at st dot com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Linux RedHat 6.2/7.3 PHP Version: 4.3.1 New Comment:
Using date('m') and date('d') are wrong as those have the leading zeros in them. Not bug in PHP. Previous Comments: ------------------------------------------------------------------------ [2003-03-30 05:59:35] noel at crewe-it-nosp dot co dot uk I've also hit the problem with mktime giving incorrect results. On 4.3.2-dev it atually returns -3662 as the date value. Worse though, it returns the same value for 31st March 2002 28th March 2004 27th March 2005 26th March 2006 and so on. ------------------------------------------------------------------------ [2003-03-30 03:25:45] jacques dot daguerre at st dot com PHP Bug with mktime ???.. I just checked with 2 different versions of PHP : PHP 4.1.2 and PHP 4.2.1... Sorry I have not installed the latest version but I could not find anything in the changelog either !.. The following code TODAY (only today March 30th, 2003) is not giving the expected output . $lastmonth1 = mktime (0,0,0,(date("m")-1),date("d"),date("Y")); $lastmonth = date ("Y-m-d", $lastmonth1); The result of lastmonth should show "2003-02-28" and it shows "2003-03-02".. Looks like a bug to me ! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22957&edit=1