[Libreoffice-bugs] [Bug 130049] ISO 8601 date representation of years BC is off by 1
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Mon Jan 20 13:47:24 UTC 2020
https://bugs.documentfoundation.org/show_bug.cgi?id=130049
--- Comment #3 from Eike Rathke <erack at redhat.com> ---
Not having year 0000 is on purpose.
For one, there is no year zero in the proleptic Gregorian calendar, see
https://en.wikipedia.org/wiki/Year_zero
ISO 8601:2004 uses astronomical year numbering, see
https://en.wikipedia.org/wiki/Year_zero#ISO_8601
Second, the calendar algorithm is also used to store dates in ODF which is
defined with XML Schema Part 2, that has no year 0. Citing from
include/tools/date.hxx
"
Year value 0 is unused. The year before year 1 CE is year 1 BCE, which is
the traditional proleptic Gregorian calendar.
This is not how ISO 8601:2000 defines things (but ISO 8601:1998 Draft
Revision did), but it enables class Date to be used for writing XML files
as XML Schema Part 2 in D.3.2 No Year Zero says
"The year "0000" is an illegal year value.", see
https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#noYearZero
and furthermore the note for 3.2.7 dateTime
https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#dateTime
"
If you don't want hell to break loose then don't touch that..
If you want an ISO 8601:2004 compliant calendar then introduce a new calendar
in i18npool instead and make it available to number formatting and others.
(In reply to Oliver Brinzing from comment #2)
> btw: noticed, that opening attached file (created with LO 6402) with LO
> 4.4.72 will show wrong values:
Of course, BCE Gregorian dates were implemented later for 5.3. Earlier there
were several places in the code that couldn't cope with negative years at all.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200120/77bf64ae/attachment.htm>
More information about the Libreoffice-bugs
mailing list