Well the responses on this one were bigger than Ben Hur. I received more
information than I thought it was possible to have on the issue ( including
almost all the possible approaches to algorithms - thank you ), had fun
leaning about the Julian and Gregorian calendars, and leant a new word (
"nutation" see Stuart McKenzies' summary).
All in all, a plethora of wisdom. Don't read through it if you can't spare
at least 15 mins !
Note: for Mr HemphillM_at_mar.dfo-mpo.gc.ca - your solution was different from
the universal consensus. I'd re-check it perhaps if I were you ....
Thanks to:
Larry Garrett [Larry_Garrett_at_csx.com]
Peter.Stern_at_weizmann.ac.il
Wigg, David [David.Wigg_at_getronics.com]
C.Ruhnke [i769646_at_smrs013a.mdc.com]
Bob Vickers [bobv_at_dcs.rhbnc.ac.uk]
fhauers_at_rke.de
Richard Rogers [R.M.Rogers_at_staffs.ac.uk]
Dipl.-Phys. S. Richter, IKP, Tel. 16-5152 [SIMONE_at_ikp.tu-darmstadt.de]
Nikola Milutinovic [Nikola.Milutinovic_at_ev.co.yu]
trey_at_ministry.eu.org
Tame, Richard [richard.tame_at_compaq.com]
alf_at_northpower.com.au
Robert Mulley [genius_at_one.net.au]
alan_at_nabeth.cxo.dec.com
kevin_at_meso.com
Hoover, Tony [hoover_at_sal.ksu.edu]
stan [stan_at_astro.temple.edu]
And those who provided a little extra, or something else of interest ....
Lucio Chiappetti [lucio_at_ifctr.mi.cnr.it]
- all years divisible by 4 are leap, but
- years divisible by 100 (1700, 1800, 1900) are NOT leap, but
- years divisible by 400 (1600, 2000) are leap
A great place to look is
http://www.tondering.dk/claus/cal/calendar21.html
You should find a good encyclopedia with a section on "perpetual
calendars".
I used my old Science & Technology Encyclopedia (in italian, but there
should
be also a McGraw Hill edition) long ago to write the enclosed Fortran
program
which produces a calendar for any year (both julian and gregorian).
Steve Thompson [smt_at_NICS1.corning.com]
1. year divisible by 4? no -> not a leap year; yes -> go to #2
2. year divisible by 400? yes -> is a leap year; no -> go to #3
3. year divisible by 100? yes -> not a leap year; no -> is a leap
year
Daniel Monjar [dmonjar_at_monjard.orgtek.com]
http://www.amherst.edu/~atstarr/leapday.html
Jim Fitzmaurice [jpfitz_at_fnal.gov]
The length of a year is actually 365.24219 days not 365.25 days as
is
commonly thought, so a leap year is evenly divisible by 4. But that would
throw off the calendar by about 3 days every 400 years so the last day of
the century, e.g.. 1800, 1900, 2000, 2100 is not a leap year unless it's
evenly divisible by 400. This effectively makes the average length of the
year 365.2425 days. The difference between this length and the true
length
will not have a serious effect for thousands of years, about 3 days in
10,000 years in fact. But Tru64-UNIX and all other flavors of UNIX that I
have encountered are aware of this, Type in "cal 1900" and you will see
that
February only has 28 days.
UNIX also smart enough to know that in September of 1752 Britain and
her
colonies adopted the Gregorian calendar and the 365.2425 day year. Enter
the
command "cal 1752" and check out September. You'll see the month only has
24
days, September 2nd is followed by September 14th.(It was a leap year as
well.)
So you don't have to worry about it if you use UNIX commands to get
your
dates, "date" and "cal" You could write a script to do the math, or use
the
"cal" command in a simple script like:
#!/bin/ksh
if cal 02 $1 | grep 29 > /dev/null
then
echo "\n$1 is a leap year.\n"
else
echo "\n$1 is not a leap year.\n"
fi
This is the quickest way I know to check for a leap year. UNIX knows, so
just ask it.
Dyer, Steve J. [Steve.Dyer_at_alcoa.com]
See
http://www.nrc.ca/inms/faq/time.html. It explains the rules very
well.
HemphillM_at_mar.dfo-mpo.gc.ca
leap years are years divisible by 4
except years divisible by 100 are not leap years
except years divisible by 1000 are leap years
except years divisible by 10000 are not leap years
This adjusts for extra quarter day + 11 minutes in the solar year.
This keeps the calendar in synch with great accuracy.
The scheme was devised by the Jesuit mathematician and
astronomer Cristoph Clavius in the time of Pope Gregory XIII
[1582].
managers account [managers_at_2100-1.mcb.net]
The creeping is actually due to nutation - the 'wobbling' action of the
earth's axis.
regds
stuart mckenzie
Jean-Louis Oneto [oneto_at_obs-azur.fr]
You could have a look on the following page:
http://www.as.wvu.edu/~jel/skywatch/skw9602a.htm
or on
http://an2000.univ-lille1.fr/an2000/Fond/CalendrierGregorien.htm
if you are not allergic to
French ;-)
Have a nice day and next century/millenium (which only begins on Jan 1st,
2001 by the way !)
Ian Mortimer [ian_at_physics.uq.edu.au]
I just worked this out off the top of my head so you should
check it but I think this is correct:
All years including leap years repeat on a 28 year cycle.
A year which follows a leap year will repeat in 6 years.
A year before a leap year or a year half way between leap
years will repeat in 11 years.
The only time this will fail is when you cross a century that
isn't a leap year. That won't happen until 2100. We should
live that long!
Regards
Ian
Kundert, Robin [rkundert_at_spu.edu]
If [the year is divisible by 4]
Then If [the year is divisible by 100]
Then If [the year is divisible by 400]
Then <it is a leap year>
Else <it is NOT a leap year>
If End
Else <it is a leap year>
Else <it is NOT a leap year>
If End
Herman_Fredriksson_at_perpetual.com.au
Hi Danielle,
Here is a classic C fragment from K&R's "The C Programming Language"
if ( ( year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
{
/* the year is a leap year */
}
else
{
/* it isn't */
}
Frank Wortner [frank_at_bondnet.com]
As far as "rolling back" to 1972, I would be very cautious about doing
this. Many commands are time sensitive, and you might be creating worse
problems than the ones you are trying to "solve."
Wendy Fong [wfong_at_synacom.com]
Check out this website:
http://www.mnsinc.com/utopia/Calendar/Year_Correlations.html
Mark.Scarborough_at_broadwing.com
All this mess really boils down to is to make the length of the average
year closer to
the actual length of the solar year.
If every 4 years you have a leap year, the average year length is:
((365+365+365+366) / 4) or 365.25.
If you disallow all century years (years ending in "00") the average
becomes:
(((76 * 365) + (24 * 366)) / 100) or 365.24.
If you then add back in the years divisible by 400 the average becomes:
(((303 * 365) + (97 * 366)) / 400) or 365.2425 which is fairly accurate.
Now all they have to do is add "leap seconds" every once in a while to
keep up.
Check out the National Institute of Standards if you want to verify:
http://www.nist.gov/y2k/leapyear.htm
You can also find information on why the year 2000 is not the first year
of the new
millennium but that is a different soap box...
Hope this helps!
Mark
Daniel West [west.daniel_at_epa.gov]
Check out the following URLs
http://www.amherst.edu/~atstarr/leapday.html
http://astro.nmsu.edu/~lhuber/leaphist.html
Steve VanDevender [stevev_at_hexadecimal.uoregon.edu]
You may find the unix 'cal' command useful for examining calendar
patterns. In general the calendar follows a 28-year cycle,
broken up slightly by those century non-leap years.
Pirie Hart [pirie_at_u.washington.edu]
if (mod(year,400) == 0) then year is leap year
else if (mod(year,100) == 0) then year is NOT leap year
else if (mod(year,4) == 0) then year is leap year
else year is NOT leap year
Jerry Marty [jerrym_at_zoomtel.com]
If you look at the compaq web site in the Y2K readiness program section,
they have a nice little flowchart that tells you the algorithm for
determining what's a leap year and what's not...I can't find it just now,
but when I was digging around for info on my alphaservers and various
revs
of Dec UNIX, I ran into it a few times, so it's gotta be in there
somewhere.
Received on Mon Dec 13 1999 - 01:33:19 NZDT