[Gambas-bugtracker] Bug #1993: Weekday function calculates weekday errors before 1582-10-5.
bugtracker at gambaswiki.org
bugtracker at gambaswiki.org
Sun Nov 29 22:03:52 CET 2020
http://gambaswiki.org/bugtracker/edit?object=BUG.1993&from=L21haW4-
Comment #1 by Benoît MINISINI:
Yes, it is not well explained in the documentation.
The Gregorian calendar has been extended in the past.
Consequently, dates are Gregorian dates from 1582-10-15. But they are not julian dates before, and so the day before 1582-10-15 is 1582-10-14, which does not exist in the Julian calendar.
To get the Julian date before 1582-10-15, you have to subtract ten days, but still use the past-extended Gregorian date to compute the week day.
Date printing correctness has been sacrificed to date arithmetic correctness. This is by design: each country having its own specific variations in calendar, I chose to not to implement any of them, and just generalized the Gregorian calendar that is mostly understood all other the world now.
But conceptually you are right: specific date to string and string to date conversion routines should exist for every type of calendar and countries. But this is a huge task, and I don't think it is managed by the OS yet!
More information about the Bugtracker
mailing list