ex9.pp 509 B

123456789101112131415161718192021222324252627282930
  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. Assign(f,ParamStr(1));
  20. Reset(f);
  21. GetFTime(f,Time);
  22. Close(f);
  23. UnPackTime(Time,DT);
  24. Write ('File ',ParamStr(1),' is last modified on ');
  25. Writeln (L0(DT.Month),'-',L0(DT.Day),'-',DT.Year,
  26. ' at ',L0(DT.Hour),':',L0(DT.Min));
  27. end.