Date to Day-of-Week Conversion (Question)

Mark Turner markt at tse.uucp
Thu Jun 20 03:07:53 AEST 1991



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 at tse.UUCP), The Toronto Stock Exchange    




More information about the Comp.lang.c mailing list