home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp21beta.zip / LEXMPSRC.RAR / TIME.PAS < prev   
Pascal/Delphi Source File  |  2000-08-15  |  1KB  |  36 lines

  1. {█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█}
  2. {█                                                       █}
  3. {█      Virtual Pascal for Linux                         █}
  4. {█      Test example for date / time functions           █}
  5. {█      ─────────────────────────────────────────────────█}
  6. {█      Copyright (C) 1999 Joerg Pleumann                █}
  7. {█                                                       █}
  8. {▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}
  9.  
  10. program Time;
  11.  
  12. uses
  13.   Dos;
  14.  
  15. var
  16.   Year, Month, Day, DayOfWeek, Hour, Minute, Second, Sec100: LongInt;
  17.  
  18. begin
  19.   GetDate(Year, Month, Day, DayOfWeek);
  20.   GetTime(Hour, Minute, Second, Sec100);
  21.  
  22.   Write('Date is: ', Year:4, '/', Month:2, '/', Day:2, ', ');
  23.  
  24.   case DayOfWeek of
  25.     0: WriteLn('Sunday');
  26.     1: WriteLn('Monday');
  27.     2: WriteLn('Tuesday');
  28.     3: WriteLn('Wednesday');
  29.     4: WriteLn('Thursday');
  30.     5: WriteLn('Friday');
  31.     6: WriteLn('Saturday');
  32.   end;
  33.  
  34.   WriteLn('Time is: ', Hour: 2, ':', Minute:2, ':', Second, '.', Sec100 * 10);
  35. end.
  36.