masquerader
2006-04-20 18:26:33
yeah, this converts a date to which day of the week it is
i dont know how it works, i found the formula on the internet :p
its not really good for anything, but i typed in some holidays and whatever
you can find out on what day you were born :cool:
i dont know how it works, i found the formula on the internet :p
its not really good for anything, but i typed in some holidays and whatever
you can find out on what day you were born :cool:
program dayofweek;
var
year:integer;
function numberday(number:integer):string;
begin
case number of
0:result:='Sunday';
1:result:='Monday';
2:result:='Tuesday';
3:result:='Wednesday';
4:result:='Thursday';
5:result:='Friday';
6:result:='Saturday';
end;
end;
function convert(day,month,year:integer):string;
var
a,y,m:integer;
begin
a:=(14-month) div 12;
y:=year-a;
m:=month+ 12*a -2;
result:=numberday((day + y + y div 4 - y div 100 + y div 400+ (31 * m) div 12)mod 7);
end;
procedure holidays;
begin
writeln('The year is '+inttostr(year));
writeln('New Years: '+convert(1,1,year))
writeln('Valentines Day: '+convert(14,2,year))
writeln('St Patricks Day: '+convert(17,3,year))
writeln('April Fools: '+convert(1,4,year))
writeln('Earth Day: '+convert(22,4,year))
writeln('July 4: '+convert(4,7,year))
writeln('Halloween: '+convert(31,10,year))
writeln('Christmas: '+convert(25,12,year))
end;
begin
year:=2006;
holidays;
//you can do your birthday or whatever, format is day,month,year
end.