ex9.pp 565 B

123456789101112131415161718192021222324252627282930313233
  1. Program Example9;
  2. uses Dos;
  3. { Program to demonstrate the GetFTime function. }
  4. Function L0(w:word):string;
  5. var
  6. s : string;
  7. begin
  8. Str(w,s);
  9. if w<10 then
  10. L0:='0'+s
  11. else
  12. L0:=s;
  13. end;
  14. var
  15. f : File;
  16. Time : Longint;
  17. DT : DateTime;
  18. begin
  19. if Paramcount>0 then
  20. Assign(f,ParamStr(1))
  21. else
  22. Assign(f,'ex9.pp' );
  23. Reset(f);
  24. GetFTime(f,Time);
  25. Close(f);
  26. UnPackTime(Time,DT);
  27. Write ('File ',ParamStr(1),' is last modified on ');
  28. Writeln (L0(DT.Month),'-',L0(DT.Day),'-',DT.Year,
  29. ' at ',L0(DT.Hour),':',L0(DT.Min));
  30. end.