Newsgroups: comp.lang.c Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!mprgate.mpr.ca!mars!stone From: stone@mars.mpr.ca (Darren Stone) Subject: Request for simple date routines. Message-ID: <1991Apr9.234255.143@mprgate.mpr.ca> Sender: news@mprgate.mpr.ca Organization: MPR Teltech Ltd. Date: Tue, 9 Apr 91 23:42:55 GMT Hi. Just a simple request I hope somebody can easily pull out of their toolbox... (1) I'd like a function which, given a date, returns 0..6 representing the day of the week of the date. (2) I'd also like a function which, given 2 dates, returns the number of days between them. I really don't care at all about efficiency, but they must work absolutely reliably for +/- several hundred years (taking into account the leap-year rules). Actually, what are the leap year rules? Something about evenly divisible by 4, except not by 100, except by 400? Thanx in advance. - Darren -