Newsgroups: comp.lang.c Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!geac!tse!markt From: markt@tse.uucp (Mark Turner) Subject: Date to Day-of-Week Conversion (Question) Message-ID: <1991Jun19.170753.593@tse.uucp> Reply-To: markt@tse.UUCP (Mark Turner) Organization: Toronto Stock Exchange Distribution: na Date: Wed, 19 Jun 91 17:07:53 GMT Hi folks! Can anyone help me with suggestions on how to convert a date to a day of the week? For example, I start with a date like '19910619'; I'd like some function to return 'Wed' or '4' or some such indication of the day. This must be doable! One caveat: I'd rather not use a shell script (for instance, I could do this using cal and awk) - C would be best. Please don't suggest that I should reset the system date and then pass a "tm" structure to the one of the ctime-related functions. I'd like to keep the machine up and running throughout the entire calculation!! :-) Please mail and I'll post summaries if there is any interest (and the answer *isn't* too embarassingly obvious). -------------------------------------------------------------------------------- Mark Turner (markt@tse.UUCP), The Toronto Stock Exchange