From: Operating system: Ubuntu PHP version: Irrelevant Package: Date/time related Bug Type: Bug Bug description:Unexpected date("m",mktime_output) Output
Description: ------------ --- >From manual page: http://www.php.net/function.date --- $tm = date('Y-m-d H:i:s'); $quarter = ceil(date("m", $tm)/3); echo '<br> Current Quarter Is: '.$quarter.' Because date is:'.date("m", $tm).' Time is:'.$tm.' month is:'.date("m").'<br>'; #### Output Below shows that date("m", $tm) is producing wrong output, but date("m") is producing correct output. The PHP version is 5.2.10-2ubuntu6.5 but I believe that does not matter as the bug reports I have reviewed don't talk about this behavior. #### Current Quarter Is: 4 Because date is:12 Time is:2011-02-06 15:25:00 month is:02 -- Edit bug report at http://bugs.php.net/bug.php?id=53942&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53942&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53942&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53942&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53942&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53942&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53942&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53942&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53942&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53942&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53942&r=support Expected behavior: http://bugs.php.net/fix.php?id=53942&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53942&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53942&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53942&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53942&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53942&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53942&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53942&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53942&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53942&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53942&r=mysqlcfg