{$I-}
{$IFDEF MSDOS}
{$V-,S-,F+,R-,X-,O+}
{$ENDIF}

Unit MKDos;

Interface

Function GetDosDate: LongInt;

Implementation

Uses
  tMisc,
{$IFNDEF WIN32}
  DOS;
{$ELSE}
  SysUtils,
  OpCrt;
{$ENDIF}

Function GetDosDate: LongInt;
Var
  DT            : DateTime;
  DosDate       : LongInt;
  DOW           : {$IFNDEF WIN32} SysInt {$ELSE} Word {$ENDIF};

Begin

{$IFDEF WIN32}
  With DT Do
  Begin
    DecodeTime (Now, Word (Hour), Word (Min), Word (Sec), Word (DOW));
    DecodeDate (Now, Word (Year), Word (Month), Word (Day));
  End;
{$ELSE}
  GetDate (DT. Year, DT. Month, DT. Day, DOW);
  GetTime (DT. Hour, DT. Min, DT. Sec, DOW);
{$ENDIF}

  PackTime (DT, DosDate);
  GetDosDate := DosDate;
End;

End.