[fpc-pascal]Week Day

James_Wilson at i2.com James_Wilson at i2.com
Thu Apr 19 14:44:49 CEST 2001

> No assembler is required; it's easily done in Pascal:

> function Weekday(D,M,Y: word): word;
>   (* Input D=day (1..31), M=month(1..12), Y=year(e.g. 2001) *)
>   (* Returns 0=Sunday, 1=Monday, ... 6=Saturday *)

This seems to work very well. Thanks.

One question; does it properly handle leap years? Is that what the "if M >
2 then Y1..." line is for?


More information about the fpc-pascal mailing list