PROGRAM TestTime;

{ programma om de unix->dos->unix tijd conversie routines te controleren }

USES Dos,
     UnixTime;

VAR OrgDT,
    DT    : DateTime;
    U     : LONGINT;
    Y,M   : WORD;

BEGIN
     WITH DT DO
     BEGIN
          Year:=1996;
          Month:=3;
          Day:=10;
          Hour:=17;
          Min:=20;
          Sec:=1;

          FOR Y:=1970 TO 2500 DO
              FOR M:=1 TO 12 DO
              BEGIN
                   Write (Y,' ',M,' ',#13);

                   DT.Year:=Y;
                   DT.Month:=M;
                   OrgDT:=DT;
                   DosToUnix (DT,U);
                   UnixToDos (U,DT);
                   IF (OrgDT.Year  <> Year) OR
                      (OrgDT.Month <> Month) OR
                      (OrgDT.Day   <> Day) OR
                      (OrgDT.Hour  <> Hour) OR
                      (OrgDT.Min   <> Min) OR
                      (OrgDT.Sec   <> Sec) THEN
                      Break;
              END;
     END; { with }

     WITH OrgDT DO
          WriteLn ('In: ',Year,' ',Month,' ',Day,' ',Hour,' ',Min,' ',Sec);
     WITH DT DO
          WriteLn ('DT: ',Year,' ',Month,' ',Day,' ',Hour,' ',Min,' ',Sec);
END.
