Article View: comp.lang.basic.misc
Article #99What's the day of the week?
From: Ian Staples
Date: Sat, 24 Feb 1996 00:00
Date: Sat, 24 Feb 1996 00:00
57 lines
2864 bytes
2864 bytes
From time to time one sees questions about programs to turn dates into days elapsed, days of the week, etc. For those who are inclined to develop a "generic" program to do this sort of thing over a long period of time, here are a few complications to consider (Ref: The New Encyclopaedia Britannica 15th Edition 1983): In the 16th Century, Pope Gregory XIII introduced the so-called Gregorian calendar to replace the earlier Julian calendar. The purpose was to recalibrate to calendar year with the celestial year so that the vernal equinox would once again fall on 21 March as it had at the time of the Council of Nicaea in AD 325. The major effect was the "loss" of 11 days in October 1582 -- it was proclaimed that the day following 4 Oct 1582 would be 15 Oct 1582. And, apart from some rioting in the streets and similar statements of concern by the great unwashed at the "loss" of 11 days from their lives, this change was put into effect. Unfortunately, the wider world didn't immediately fall into line with this papist decree. In fact, some delayed their response by a Century or two. The introduction of this geopolitical variation will further complicate attempts at "generic" programming of dates. For those who still harbour such ambitions the following data may be helpful: Year of transition to the Gregorian calendar: 1582 Italian states, Portugal, Spain 1583 Catholic German states 1699 Protestant German states 1752 England and colonies 1753 Sweden 1873 Japan 1912 China 1918 Soviet Union 1923 Greece Apart from dropping a few days, the Gregorian calendar only differs from the Julian in that no century year is a leap year unless exactly divisible by 400 (i.e. the year 2000 will be a leap year). A further refinement, years evenly divisible by 4000 are NOT leap years, will keep it accurate to within 1 day in 20,000 years. Oh, and don't forget that Muslim countries tend to retain calendars based on Islam. :-) Cheers, and may your algorithms be concise, Ian S. -- Ian Staples E-mail : I.Staples@dpi.qld.gov.au c/- P.O. Box 1054 MAREEBA Phone : +61 (0)70 928 555 Home 924 847 Queensland Australia 4880 Fax : +61 (0)70 923 593 " " "
Technical Details
Message-ID:
<DnA5v0.1tJ@planet.mh.dpi.qld.gov.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d683,e275cf064401e55b,start X-Google-Attributes: gid10d683,public X-Google-Thread: 10c949,e275cf064401e55b,start X-Google-Attributes: gid10c949,public From: staplei@planet.mh.dpi.qld.gov.au (Ian Staples) Subject: What's the day of the week? Date: 1996/02/24 Message-ID: <DnA5v0.1tJ@planet.mh.dpi.qld.gov.au> X-Deja-AN: 140850109 organization: Qld Department of Primary Industries keywords: date,day,gregorian,calendar newsgroups: comp.lang.basic.misc,aus.computers.ibm-pc summary: It's not simple to program