From: Operating system: Linux PHP version: 5.3.10 Package: *Calendar problems Bug Type: Bug Bug description:gregoriantojd() returns incorrect date for some dates
Description: ------------ I am using gregoriantojd() to return the Julian date for some months in the year 2011. It gives the correct answer for 10 of the months, but August and September just get returned as "0". Test script: --------------- echo "The 1st of January 2011 is " . gregoriantojd(01, 01, 2011) . PHP_EOL; echo "The 1st of February 2011 is " . gregoriantojd(02, 01, 2011) . PHP_EOL; echo "The 1st of March 2011 is " . gregoriantojd(03, 01, 2011) . PHP_EOL; echo "The 1st of April 2011 is " . gregoriantojd(04, 01, 2011) . PHP_EOL; echo "The 1st of May 2011 is " . gregoriantojd(05, 01, 2011) . PHP_EOL; echo "The 1st of June 2011 is " . gregoriantojd(06, 01, 2011) . PHP_EOL; echo "The 1st of July 2011 is " . gregoriantojd(07, 01, 2011) . PHP_EOL; echo "The 1st of August 2011 is " . gregoriantojd(08, 01, 2011) . PHP_EOL; echo "The 1st of September 2011 is " . gregoriantojd(09, 01, 2011) . PHP_EOL; echo "The 1st of October 2011 is " . gregoriantojd(10, 01, 2011) . PHP_EOL; echo "The 1st of November 2011 is " . gregoriantojd(11, 01, 2011) . PHP_EOL; echo "The 1st of December 2011 is " . gregoriantojd(12, 01, 2011) . PHP_EOL; Expected result: ---------------- The 1st of January 2011 is 2455563 The 1st of February 2011 is 2455594 The 1st of March 2011 is 2455622 The 1st of April 2011 is 2455653 The 1st of May 2011 is 2455683 The 1st of June 2011 is 2455714 The 1st of July 2011 is 2455744 The 1st of August 2011 is 2455775 The 1st of September 2011 is 2455805 The 1st of October 2011 is 2455836 The 1st of November 2011 is 2455867 The 1st of December 2011 is 2455897 Actual result: -------------- The 1st of January 2011 is 2455563 The 1st of February 2011 is 2455594 The 1st of March 2011 is 2455622 The 1st of April 2011 is 2455653 The 1st of May 2011 is 2455683 The 1st of June 2011 is 2455714 The 1st of July 2011 is 2455744 The 1st of August 2011 is 0 The 1st of September 2011 is 0 The 1st of October 2011 is 2455836 The 1st of November 2011 is 2455867 The 1st of December 2011 is 2455897 -- Edit bug report at https://bugs.php.net/bug.php?id=61135&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61135&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61135&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61135&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61135&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61135&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61135&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61135&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61135&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61135&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61135&r=support Expected behavior: https://bugs.php.net/fix.php?id=61135&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61135&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61135&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61135&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61135&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61135&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61135&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61135&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61135&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61135&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61135&r=mysqlcfg