home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18225 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  667 b 

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!uniol!olis!fast!uucp
  2. From: Ulrich.Breymann%p17.f2002.n241.z2@fidonet.org (Ulrich Breymann)
  3. Newsgroups: comp.lang.c++
  4. Subject: Date -> Day of week conversion
  5. Message-ID: <724698107.AA07504@fast.fast.fido.de>
  6. Date: 14 Dec 92 15:57:00 GMT
  7. Article-I.D.: fast.724698107.AA07504
  8. Sender: uucp@fast.fast.fido.de
  9. Lines: 12
  10.  
  11. hello Ijaz,
  12. try this :
  13.  
  14. // dow (day of week) computes weekday in the range 14.9.1752..31.12.2399
  15. // So=0  Mo=1... Sa =6
  16. int dow(int d,int m, int y)      // day month year
  17. {
  18.   return (3*y-7*(y+(m+9)/12)/4+23*m/9+d+3
  19.          -((y-(m<3))/100+1)*3/4)%7;
  20. }
  21.  
  22. bye ! Uli
  23.