Function CalWkDay(Year,Month,Day:Word) : Integer;
{get day of week from date, Franz Glaser}
Var Cent : Integer;
    Wt : Longint;
Begin
  if Year < 100 then
    Begin
      if Year > 80 then 
        Year := Year + 1900 
      else 
        Year := Year + 2000;   {Y2k solution...}
    End;
  if Month > 2 then
    Dec(Month,2)
  else
    Begin
      Inc(Month,10);
      Dec(Year);
    End;
  Cent := Year div 100;
  Year := Year mod 100;
  Wt := (13*Month -1) div 5 + Year div 4 + Cent div 4 + Year + Day - Cent - Cent ;
  Wt := Wt mod 7;
  if Wt < 0 then Inc(Wt,7);
  CalWkDay := Wt;
End;

    Source: geocities.com/SiliconValley/2926/tpsrc

               ( geocities.com/SiliconValley/2926)                   ( geocities.com/SiliconValley)