Dates and Times

Jordan Brown lcc.jbrown at LOCUS.UCLA.EDU
Wed Sep 3 21:36:10 AEST 1986


> Is there also a simple routine that will allow me to calculate
> what day of the week an arbitrary date falls on?

Once you have Julian days (or any other days-since-some-base-date scheme)
you just add some appropriate small constant (0-6) and take it modulo 7.
The small constant depends on what day of the week your base date is;
I usually just fiddle with it until I get today right.  (I can NEVER
remember what the right value is.  I THINK that for Julian the right
value is 6, but am not at all sure.)



More information about the Comp.unix mailing list