home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / DATE.ZIP / DATE.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1986-12-23  |  1.3 KB  |  57 lines

  1.  
  2.  
  3. {This program appeared in the book entitled TURBO PASCAL LIBRARY by Douglas
  4.  Stivison. It computes the day of the week a certain date appeared on.
  5.  It also gives the Julian value for the date. Be sure to get the include
  6.  file (DATE.INC). DATE.PAS is a demonstration program that shows how
  7.  to use the procedures and functions in DATE.INC.}
  8.  
  9.  
  10. program datetest;
  11.  
  12. {$I DATE.INC}
  13.  
  14. var
  15.    indate,
  16.    outdate:            datestr;
  17.    month,
  18.    day,
  19.    year,
  20.    wkday,
  21.    m1,
  22.    d1,
  23.    y1:                 integer;
  24.    jul:                real;
  25.    
  26. begin
  27.    clrscr;
  28.    writeln('Date I/O test');
  29.    writeln;
  30.    write('Enter date in MM/DD/YY format: ');
  31.    readln(indate);
  32.  
  33.    datetoint(indate, month, day, year);
  34.    wkday := dayofweek (month, day, year);
  35.    writeln;
  36.    writeln(montharray [month], ' ', day, ', ', year);
  37.    writeln;
  38.    writeln('That was a ', dayarray [wkday], '.');
  39.    writeln;
  40.    write('Integer Values: ');
  41.    writeln(month, ' ', day, ' ', year);
  42.  
  43.    jul := caljul (month, day, year);
  44.    writeln;
  45.    write('Julian Value: ');
  46.    writeln(jul : 6 : 0);
  47.  
  48.    julcal(jul, m1, d1, y1);
  49.    writeln;
  50.    write('Integer Values: ');
  51.    writeln(m1, ' ', d1, ' ', y1);
  52.  
  53.    outdate := inttodate (m1, d1, y1);
  54.    writeln;
  55.    write('String Value: ');
  56.    writeln(outdate);
  57. end.