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