Edit report at https://bugs.php.net/bug.php?id=61135&edit=1

 ID:                 61135
 Comment by:         carloschilazo at gmail dot com
 Reported by:        t dot m dot guymer at thomasguymer dot co dot uk
 Summary:            gregoriantojd() returns incorrect date for some
                     dates
 Status:             Open
 Type:               Bug
 Package:            *Calendar problems
 Operating System:   Linux
 PHP Version:        5.3.10
 Block user comment: N
 Private report:     N

 New Comment:

Confirmed, working on a fix right now, will upload it shortly


Previous Comments:
------------------------------------------------------------------------
[2012-02-18 17:26:41] t dot m dot guymer at thomasguymer dot co dot uk

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 this bug report at https://bugs.php.net/bug.php?id=61135&edit=1

Reply via email to