ex4.pp 553 B

123456789101112131415161718192021222324252627282930313233
  1. Program Example4;
  2. { This program demonstrates the DateTimeToString function }
  3. Uses sysutils;
  4. Procedure today (Fmt : string);
  5. Var S : AnsiString;
  6. begin
  7. DateTimeToString (S,Fmt,Date);
  8. Writeln (S);
  9. end;
  10. Procedure Now (Fmt : string);
  11. Var S : AnsiString;
  12. begin
  13. DateTimeToString (S,Fmt,Time);
  14. Writeln (S);
  15. end;
  16. Begin
  17. Today ('"Today is "dddd dd mmmm y');
  18. Today ('"Today is "d mmm yy');
  19. Today ('"Today is "d/mmm/yy');
  20. Now ('''The time is ''am/pmh:n:s');
  21. Now ('''The time is ''hh:nn:ssam/pm');
  22. Now ('''The time is ''tt');
  23. End.