|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-03-15 09:53 UTC] asphp at dsgml dot com
Description:
------------
cal_from_jd() returns 6 for Adar when there is only one Adar, (it should return 7, since if there is only one Adar it's AdarII).
It also says "AdarI", which is wrong (it should be either "Adar" or at least "AdarII").
Furthermore the cal_days_in_month() (correctly) only works with month 7, and not 6 as returned by cal_from_jd.
Test script:
---------------
<?
print_r(cal_from_jd(2456005, CAL_JEWISH));
echo cal_days_in_month(CAL_JEWISH, 6, 5772) . "\n";
echo cal_days_in_month(CAL_JEWISH, 7, 5772) . "\n";
?>
Expected result:
----------------
The month in cal_from_jd should be 7.
The second two lines demonstrate how cal_days_in_month also expects the month to be 7.
Actual result:
--------------
Array
(
[date] => 6/24/5772
[month] => 6
[day] => 24
[year] => 5772
[dow] => 0
[abbrevdayname] => Sun
[dayname] => Sunday
[abbrevmonth] => AdarI
[monthname] => AdarI
)
0
29
PatchesUse-AdarII-for-non-leap-years-and-test (last revision 2012-01-10 20:23 UTC by eitan at mosenkis dot net)Use-AdarII-for-non-leap-years (last revision 2012-01-10 20:06 UTC by eitan at mosenkis dot net) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 19:00:02 2025 UTC |
I think the bug still exists. Under 5.4.9 I get the same results like in the reproduce example: Array ( [date] => 6/24/5772 [month] => 6 [day] => 24 [year] => 5772 [dow] => 0 [abbrevdayname] => Sun [dayname] => Sunday [abbrevmonth] => AdarI [monthname] => AdarI ) 0 29