home *** CD-ROM | disk | FTP | other *** search
-
-
- {This program appeared in the book entitled TURBO PASCAL LIBRARY by Douglas
- Stivison. It computes the day of the week a certain date appeared on.
- It also gives the Julian value for the date. Be sure to get the include
- file (DATE.INC). DATE.PAS is a demonstration program that shows how
- to use the procedures and functions in DATE.INC.}
-
-
- program datetest;
-
- {$I DATE.INC}
-
- var
- indate,
- outdate: datestr;
- month,
- day,
- year,
- wkday,
- m1,
- d1,
- y1: integer;
- jul: real;
-
- begin
- clrscr;
- writeln('Date I/O test');
- writeln;
- write('Enter date in MM/DD/YY format: ');
- readln(indate);
-
- datetoint(indate, month, day, year);
- wkday := dayofweek (month, day, year);
- writeln;
- writeln(montharray [month], ' ', day, ', ', year);
- writeln;
- writeln('That was a ', dayarray [wkday], '.');
- writeln;
- write('Integer Values: ');
- writeln(month, ' ', day, ' ', year);
-
- jul := caljul (month, day, year);
- writeln;
- write('Julian Value: ');
- writeln(jul : 6 : 0);
-
- julcal(jul, m1, d1, y1);
- writeln;
- write('Integer Values: ');
- writeln(m1, ' ', d1, ' ', y1);
-
- outdate := inttodate (m1, d1, y1);
- writeln;
- write('String Value: ');
- writeln(outdate);
- end.