Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!deimos.cis.ksu.edu!rutgers!hjuxa!mal From: mal@hjuxa.UUCP (LEACH) Newsgroups: comp.lang.pascal Subject: Re: Day-of-week algorithm, please! Message-ID: <1436@hjuxa.UUCP> Date: 13 Apr 89 13:27:45 GMT References: <2394@maccs.McMaster.CA> Organization: Digital Equipment Corp, Manalapan NJ Lines: 18 From article <2394@maccs.McMaster.CA>, by cs3b3aj@maccs.McMaster.CA (Stephen M. Dunn): > In article <1780001@hpcc01.HP.COM> azarian@hpcc01.HP.COM (Randy Azarian) writes: > ... >> total := total + + (year - 1) div 4; > > But watch out, because not every year such that year mod 4 = 0 is a leap > year! The strangeness in the pattern occurs on century years, but I'm not > sure which way round it is. It is either that years divisible by 400 are A year is a leap year if it is evenly divisible by 4 and not evenly divisible by 100; unless, of course, it is divisible by 400. 1900 was not a leap year. 2000 will be. -- Michael A. Leach uucp: {decvax,clyde,rutgers,decuac}!hjuxa!mal email: hjuxa!mal@decuac.dec.com OR leach@unxa.dec.com