Doc #63930 [Ver->Csd]: cal_from_jd['dow'] gives 0 for Sunday
| From: | cmb@php.net | Date: | Thu, 01 Mar 2018 12:26:53 +0000 |
| Subject: | Doc #63930 [Ver->Csd]: cal_from_jd['dow'] gives 0 for Sunday | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15487@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63930&edit=1
ID: 63930
Updated by: cmb@php.net
Reported by: r07271368 at hotmail dot com
Summary: cal_from_jd['dow'] gives 0 for Sunday
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Calendar related
Operating System: testbed at tehplayground.com
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2018-03-01 12:26:18] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=344407
Log: Fix bug #63930: cal_from_jd['dow'] gives 0 for Sunday
------------------------------------------------------------------------
[2013-01-07 10:28:23] r07271368 at hotmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.cal-from-jd#refsect1-function.cal-from-jd-returnvalues
---
The documentation for cal_to_jd fails to state the range of values for element 'dow' of
the output array.
It appears that the values range from 0 to 6, with 0 meaning Sunday.
Test script:
---------------
echo "Result for Saturday, January 1, 2000:"
$d = cal_to_jd(CAL_GREGORIAN, 1, 1, 2000);
print_r(cal_from_jd($d, CAL_GREGORIAN));
echo "\n\n";
echo "Result for Sunday, January 2, 2000:"
$d = cal_to_jd(CAL_GREGORIAN, 1, 2, 2000);
print_r(cal_from_jd($d, CAL_GREGORIAN));
Expected result:
----------------
Array
(
[date] => 1/1/2000
[month] => 1
[day] => 1
[year] => 2000
[dow] => 6
[abbrevdayname] => Sat
[dayname] => Saturday
[abbrevmonth] => Jan
[monthname] => January
)
Array
(
[date] => 1/2/2000
[month] => 1
[day] => 2
[year] => 2000
[dow] => 7
[abbrevdayname] => Sun
[dayname] => Sunday
[abbrevmonth] => Jan
[monthname] => January
)
Actual result:
--------------
Array
(
[date] => 1/1/2000
[month] => 1
[day] => 1
[year] => 2000
[dow] => 6
[abbrevdayname] => Sat
[dayname] => Saturday
[abbrevmonth] => Jan
[monthname] => January
)
Array
(
[date] => 1/2/2000
[month] => 1
[day] => 2
[year] => 2000
[dow] => 0
[abbrevdayname] => Sun
[dayname] => Sunday
[abbrevmonth] => Jan
[monthname] => January
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63930&edit=1