In message <[EMAIL PROTECTED]>, Martin Phillips <[EMAIL PROTECTED]> writes
Hi Mark,

The U2 conversion code source code is not public so we can only guess. The method used by OpenQM was recently changed to correct problems with dates way back in history and is essentially as follows. It sounds complex but it is mostly just a series of division operations.....

1. Add 718430 to the day number. This gives a datum of 1 January 0001 to simplify things. (QM documents that it doesn't support BC dates and that we don't allow for the calendar changes in 1752 or 1583 depending on where you live).

Or 1919 :-) I always like to point out that 2000 was the first "century year" since 1600 when Europe actually agreed whether it was a leap year or not.

2. Divide by 146097 to work out how many 400 year cycles we have completed. This allows for the complications of leap year calculations.

I'd've thought you could handle the calendar change dead easy here... just have a cut-off date (user selectable :-) for the switch between calendars, and if it's before that date you apply a constant, while if it's after you apply this 400 correction. At the cost of one extra IF, you've now got accurate dates right back to start of the modern calendar.

Cheers,
Wol
--
Anthony W. Youngman <[EMAIL PROTECTED]>
'Yings, yow graley yin! Suz ae rikt dheu,' said the blue man, taking the
thimble. 'What *is* he?' said Magrat. 'They're gnomes,' said Nanny. The man
lowered the thimble. 'Pictsies!' Carpe Jugulum, Terry Pratchett 1998
Visit the MaVerick web-site - <http://www.maverick-dbms.org> Open Source Pick
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to