home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mksmvp10.zip / MKDOS.PAS < prev    next >
Pascal/Delphi Source File  |  1997-09-28  |  1KB  |  66 lines

  1. Unit MKDos;
  2. {$I MKB.Def}
  3.  
  4. Interface Uses Dos, Use32, VPUtils;
  5.  
  6.  
  7. Function GetDosDate: LongInt;
  8. Function GetDOW: Word;
  9. Function TimeOut(Time:LongInt):Boolean;
  10.  
  11. Implementation
  12.  
  13. Function TimeOut(Time:LongInt):Boolean;
  14.   Var
  15.     TimeDiff: LongInt;
  16.  
  17.   Begin
  18.   TimeDiff := Time - GetTimeMSec;
  19.   If TimeDiff < 0 Then
  20.     TimeOut := True
  21.   Else
  22.     Begin
  23.     If (TimeDiff > 780000) Then
  24.     Dec(TimeDiff, 1572480);
  25.     If TimeDiff < 0 Then
  26.       TimeOut := True
  27.     Else
  28.       TimeOut := False;
  29.     End;
  30.   End;
  31.  
  32. Function GetDosDate: LongInt;
  33.   Var
  34.     {$IFDEF WINDOWS}
  35.     DT: TDateTime;
  36.     {$ELSE}
  37.     DT: DateTime;
  38.     {$ENDIF}
  39.     DosDate: LongInt;
  40.     DOW: Word;
  41.  
  42.   Begin
  43.   GetDate(DT.Year, DT.Month, DT.Day, DOW);
  44.   GetTime(DT.Hour, DT.Min, DT.Sec, DOW);
  45.   PackTime(DT, DosDate);
  46.   GetDosDate := DosDate;
  47.   End;
  48.  
  49.  
  50. Function GetDOW: Word;
  51.   Var
  52.     {$IFDEF WINDOWS}
  53.     DT: TDateTime;
  54.     {$ELSE}
  55.     DT: DateTime;
  56.     {$ENDIF}
  57.     DOW: Word;
  58.  
  59.   Begin
  60.   GetDate(DT.Year, DT.Month, DT.Day, DOW);
  61.   GetDOW := DOW;
  62.   End;
  63.  
  64.  
  65. End.
  66.