#50744 [Opn->Bgs]: Missing days in Sept 1752
| From: | derick@php.net | Date: | Thu, 14 Jan 2010 10:32:42 +0000 |
| Subject: | #50744 [Opn->Bgs]: Missing days in Sept 1752 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-146639@lists.php.net to get a copy of this message | ||
ID: 50744
Updated by: derick@php.net
Reported By: nuke at psu dot edu
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: *
PHP Version: 5.3SVN-2010-01-14 (snap)
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
PHP implements the ISO 8601 calendar (which is a proleptic Gregorian
calendar with modifications for the year 0, see
http://en.wikipedia.org/wiki/Gregorian_calendar#Proleptic_Gregorian_calendar
and http://en.wikipedia.org/wiki/ISO_8601#Dates).
The reason is that the switch over from the Julian calendar to the
Gregorian calendar wasn't in 1752 for every locality (see
http://en.wikipedia.org/wiki/Gregorian_calendar#Timeline)
If I were to
implement this correctly, then you would have to set in which locality
the calendar was used. I would also have to add support for very
specific rules for for example Sweden which messed up and required a
February 30th at one point: See the 5th and 6th paragraph of
http://en.wikipedia.org/wiki/Gregorian_calendar#Adoption_in_Europe
Previous Comments:
------------------------------------------------------------------------
[2010-01-14 08:03:59] nuke at psu dot edu
Description:
------------
In ext/date/lib/interval.c around line 58, there should be a flag to
test for years before, say, 1753, and throw a warning for people to use
the Calendar functions, assuming those functions are doing it
correctly.
I'd check the Calendar functions today, esp. GregoriantoJD, except that
it's already 3am here. Besides, that'd be a different test.
Here's one webpage about the issue I found in 1752:
http://www.genealogytoday.com/columns/everyday/030902.html
Reproduce code:
---------------
$one = new DateTime("1752-09-02 00:00:00");
$two = new DateTime("1752-09-14 00:00:00");
$diff = $one->diff($two);
echo $diff->days."=1";
Expected result:
----------------
1=1
Actual result:
--------------
12=1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50744&edit=1