From:             georgew at rationalcomputing dot ca
Operating system: Windows Vista 
PHP version:      5.2.6
PHP Bug Type:     Date/time related
Bug description:  Wrong date returned for function jewishtojd

Description:
------------
The Jewish date for Yom Kippur and Rosh Hashanah are consistently 1 day
off.  I attempted to reproduce these days for the next 10 years and
converting them to Gregorian dates and below are my results.

Please note I am using 1,1,5769 to 1,1,5778 for Rosh Hashanah (the 2nd
day) and 1,10,5769 to 1,10,5778 for Yom Kippur as shown in the reproduce
code section below.

Also, I have done it for the other Jewish holidays and although I have not
thoroughly tested there it seems correct for those. 


Reproduce code:
---------------
function heb_greg($hebmon,$hebday,$hebyear)
{
    return  jdtogregorian(jewishtojd($hebmon,$hebday,$hebyear));
}
echo (heb_greg(1,1,5769)),"<br>" ;
echo (heb_greg(1,10,5769)),"<br>" ;
echo (heb_greg(1,1,5770)),"<br>" ;
echo (heb_greg(1,10,5770)),"<br>" ;
echo (heb_greg(1,1,5771)),"<br>" ;
echo (heb_greg(1,10,5771)),"<br>" ;
echo (heb_greg(1,1,5772)),"<br>" ;
echo (heb_greg(1,10,5772)),"<br>" ;
echo (heb_greg(1,1,5773)),"<br>" ;
echo (heb_greg(1,10,5773)),"<br>" ;
echo (heb_greg(1,1,5774)),"<br>" ;
echo (heb_greg(1,10,5774)),"<br>" ;
echo (heb_greg(1,1,5775)),"<br>" ;
echo (heb_greg(1,10,5775)),"<br>" ;
echo (heb_greg(1,1,5776)),"<br>" ;
echo (heb_greg(1,10,5776)),"<br>" ;
echo (heb_greg(1,1,5777)),"<br>" ;
echo (heb_greg(1,10,5777)),"<br>" ;
echo (heb_greg(1,1,5778)),"<br>" ;
echo (heb_greg(1,10,5778)),"<br>" ;


Expected result:
----------------
The expected result is:
9/30/2008
10/8/2008
9/19/2009
9/27/2009
9/9/2010
9/17/2010
9/29/2011
10/7/2011
9/17/2012
9/25/2012
9/5/2013
9/13/2013
9/25/2014
10/3/2014
9/14/2015
9/22/2015
10/3/2016
10/11/2016
9/21/2017
9/29/2017



Actual result:
--------------
The actual result is
9/30/2008
10/9/2008
9/19/2009
9/28/2009
9/9/2010
9/18/2010
9/29/2011
10/8/2011
9/17/2012
9/26/2012
9/5/2013
9/14/2013
9/25/2014
10/4/2014
9/14/2015
9/23/2015
10/3/2016
10/12/2016
9/21/2017
9/30/2017



-- 
Edit bug report at http://bugs.php.net/?id=45534&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45534&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45534&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45534&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45534&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45534&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45534&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45534&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45534&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45534&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45534&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45534&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45534&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45534&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45534&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45534&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45534&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45534&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45534&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45534&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45534&r=mysqlcfg

Reply via email to