Browse Source

+ Initial implementation

michael 26 years ago
parent
commit
fe22fc386a
3 changed files with 65 additions and 0 deletions
  1. 33 0
      docs/sysutex/ex4.pp
  2. 16 0
      docs/sysutex/ex5.pp
  3. 16 0
      docs/sysutex/ex6.pp

+ 33 - 0
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.

+ 16 - 0
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.

+ 16 - 0
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.