ID: 11212 Comment by: burke-brooke442 at hotmail dot com Reported By: phil at goli dot at Status: Bogus Bug Type: Date/time related Operating System: FreeBSD 4.1.1-STABLE PHP Version: 4.0.5 New Comment:
<a href=http://yrussian-showermovi.da.ru>burke brooke</a> Previous Comments: ------------------------------------------------------------------------ [2001-05-31 12:51:23] [EMAIL PROTECTED] user error.. (yes, some months don't have 31 days in them) ------------------------------------------------------------------------ [2001-05-31 10:04:39] phil at goli dot at // Sorry - it's not a bug actually I think - it's just, that // date("d") returns '31' in may - therefore the calculation // does not work this way - if you use ... date("m")-2, 1, date("Y") ... it works! // current date is 31.05.2001 GMT // this should return '03' (5-2=3) -> OK echo gmdate( "m", mktime(date("H"), date("i"), date("s"), date("m")-2, date("d"), date("Y")) ).'<br>'; // this should return '02' (5-3=2) -> but returns '03' !!!! echo gmdate( "m", mktime(date("H"), date("i"), date("s"), date("m")-3, date("d"), date("Y")) ).'<br>'; // comment: yesterday it worked (on the 30.05.2001 GMT) ------------------------------------------------------------------------ [2001-05-31 09:47:17] phil at goli dot at // current date is 31.05.2001 GMT // this should return '03' (5-2=3) -> OK echo gmdate( "m", mktime(date("H"), date("i"), date("s"), date("m")-2, date("d"), date("Y")) ).'<br>'; // this should return '02' (5-3=2) -> but returns '03' !!!! echo gmdate( "m", mktime(date("H"), date("i"), date("s"), date("m")-3, date("d"), date("Y")) ).'<br>'; // comment: yesterday it worked (on the 30.05.2001 GMT) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=11212&edit=1
