mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 04:30:35 +01:00
+ Initial implementation
This commit is contained in:
parent
e7994c7195
commit
fe22fc386a
33
docs/sysutex/ex4.pp
Normal file
33
docs/sysutex/ex4.pp
Normal file
@ -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
docs/sysutex/ex5.pp
Normal file
16
docs/sysutex/ex5.pp
Normal file
@ -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
docs/sysutex/ex6.pp
Normal file
16
docs/sysutex/ex6.pp
Normal file
@ -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.
|
||||
Loading…
Reference in New Issue
Block a user