diff --git a/docs/sysutex/ex4.pp b/docs/sysutex/ex4.pp new file mode 100644 index 0000000000..6b61cf906d --- /dev/null +++ b/docs/sysutex/ex4.pp @@ -0,0 +1,33 @@ +Program Example4; + +{ This program demonstrates the DateTimeToString function } + +Uses sysutils; + + +Procedure today (Fmt : string); + +Var S : AnsiString; + +begin + DateTimeToString (S,Fmt,Date); + Writeln (S); +end; + +Procedure Now (Fmt : string); + +Var S : AnsiString; + +begin + DateTimeToString (S,Fmt,Time); + Writeln (S); +end; + +Begin + Today ('"Today is "dddd dd mmmm y'); + Today ('"Today is "d mmm yy'); + Today ('"Today is "d/mmm/yy'); + Now ('''The time is ''am/pmh:n:s'); + Now ('''The time is ''hh:nn:ssam/pm'); + Now ('''The time is ''tt'); +End. \ No newline at end of file diff --git a/docs/sysutex/ex5.pp b/docs/sysutex/ex5.pp new file mode 100644 index 0000000000..e4148a2cd8 --- /dev/null +++ b/docs/sysutex/ex5.pp @@ -0,0 +1,16 @@ +Program Example5; + +{ This program demonstrates the DateTimeToSystemTime function } + +Uses sysutils; + +Var ST : TSystemTime; + +Begin + DateTimeToSystemTime(Now,ST); + With St do + begin + Writeln ('Today is ',year,'/',month,'/',Day); + Writeln ('The time is ',Hour,':',minute,':',Second,'.',MilliSecond); + end; +End. \ No newline at end of file diff --git a/docs/sysutex/ex6.pp b/docs/sysutex/ex6.pp new file mode 100644 index 0000000000..a3aeef4c41 --- /dev/null +++ b/docs/sysutex/ex6.pp @@ -0,0 +1,16 @@ +Program Example6; + +{ This program demonstrates the DateTimeToTimeStamp function } + +Uses sysutils; + +Var TS : TTimeStamp; + +Begin + TS:=DateTimeToTimeStamp (Now); + With TS do + begin + Writeln ('Now is ',time,' millisecond past midnight'); + Writeln ('Today is ' ,Date,' days past 1/1/0001'); + end; +End. \ No newline at end of file