home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!mimsy!nmrdc1!frmug!lill!vanney.raphael
- From: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
- Newsgroups: comp.lang.pascal
- Subject: RE: DATE -> DAY OF WEEK C
- Message-ID: <967.6.uupcb@lill.frmug.fr.mugnet.org>
- Date: 20 Dec 92 19:34:00 GMT
- Reply-To: vanney.raphael@lill.frmug.fr.mugnet.org (Vanney Raphael)
- Organization: Li'LL BBS - Paris, France
- Lines: 50
-
-
- -=> Quoting Ijaz Rashid Malik to All <=-
-
- IRM> Newsgroups: comp.lang.c,comp.lang.pascal,comp.lang.c++
- IRM> From: ummalik@ccu.umanitoba.ca (Ijaz Rashid Malik)
- IRM> Subject: Date -> Day of week conversion
- IRM> Followup-To: poster
- IRM> Organization: University of Manitoba, Winnipeg, Canada
- IRM> Date: Fri, 11 Dec 1992 12:48:19 GMT
-
-
- IRM> Could someone please forward me algorithm to convert the date (in
- IRM> dd.mm.yy or yy.mm.dd format, but assume individual fields can be
- IRM> obtained as integers) to corresponding day of the week.
-
- IRM> Thanks very much.
-
- IRM> Malik
-
-
- IRM> -!- GEcho 1.00
- IRM> ! Origin: Li'LL BBS - Paris France - (33-1) 43.07.40.97 (2:320/7)
-
- Here is an efficient-if-not-clean way of doing this :
-
- Uses DOS ;
-
- Function DayOfWeek(d, m, y : Word) : Word ;
- Var sd,
- sm,
- sy,
- Dum : Word ;
- Begin
- GetDate(sy, sm, sd, Dum) ;
- SetDate(y, m, d) ;
- GetDate(y, m, d, Dum) ;
- DayOfWeek:=Dum ;
- SetDate(sy, sm, sd) ;
- End ;
-
- -> why not let the DOS do the job ! :-))
-
- Raphael.
-
-
- ... The last thing I saw was this Big Blue Wave!
- --- FMail 0.92
- * Origin: ICEBERG - La Garenne * FRANCE * Tel:(33)-1-47699261
- (2:320/1.0)
-
-