mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 22:06:08 +02:00
+ Added examples 7-12
This commit is contained in:
parent
9df9fbce24
commit
d625ef5b16
@ -32,7 +32,7 @@ endif
|
||||
|
||||
.PHONY: all tex clean
|
||||
|
||||
OBJECTS=ex1 ex2 ex3 ex4 ex5
|
||||
OBJECTS=ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 ex12
|
||||
|
||||
TEXOBJECTS=$(addsuffix .tex, $(OBJECTS))
|
||||
|
||||
|
@ -6,3 +6,9 @@ ex3.pp contains an example of the DateTimeToStr function.
|
||||
ex4.pp contains an example of the DateTimeToString function.
|
||||
ex5.pp contains an example of the DateTimeToSystemTime function.
|
||||
ex6.pp contains an example of the DateTimeToTimeStamp function.
|
||||
ex7.pp contains an example of the DateToStr function.
|
||||
exex8.pp contains an example of the DayOfWeek function.
|
||||
ex9.pp contains an example of the DecodeDate function.
|
||||
ex10.pp contains an example of the DecodeTime function.
|
||||
ex11.pp contains an example of the EncodeDate function.
|
||||
ex12.pp contains an example of the EncodeTime function.
|
||||
|
12
docs/sysutex/ex10.pp
Normal file
12
docs/sysutex/ex10.pp
Normal file
@ -0,0 +1,12 @@
|
||||
Program Example10;
|
||||
|
||||
{ This program demonstrates the DecodeTime function }
|
||||
|
||||
Uses sysutils;
|
||||
|
||||
Var HH,MM,SS,MS: Word;
|
||||
|
||||
Begin
|
||||
DecodeTime(Time,HH,MM,SS,MS);
|
||||
Writeln (format('The time is %d:%d:%d.%d',[hh,mm,ss,ms]));
|
||||
End.
|
12
docs/sysutex/ex11.pp
Normal file
12
docs/sysutex/ex11.pp
Normal file
@ -0,0 +1,12 @@
|
||||
Program Example11;
|
||||
|
||||
{ This program demonstrates the EncodeDate function }
|
||||
|
||||
Uses sysutils;
|
||||
|
||||
Var YY,MM,DD : Word;
|
||||
|
||||
Begin
|
||||
DecodeDate (Date,YY,MM,DD);
|
||||
WriteLn ('Today is : ',FormatDateTime ('dd mmmm yyyy',EnCodeDate(YY,Mm,Dd)));
|
||||
End.
|
12
docs/sysutex/ex12.pp
Normal file
12
docs/sysutex/ex12.pp
Normal file
@ -0,0 +1,12 @@
|
||||
Program Example12;
|
||||
|
||||
{ This program demonstrates the EncodeTime function }
|
||||
|
||||
Uses sysutils;
|
||||
|
||||
Var Hh,MM,SS,MS : Word;
|
||||
|
||||
Begin
|
||||
DeCodeTime (Time,Hh,MM,SS,MS);
|
||||
Writeln ('Present Time is : ',FormatDateTime('hh:mm:ss',EnCodeTime (HH,MM,SS,MS)));
|
||||
End.
|
9
docs/sysutex/ex7.pp
Normal file
9
docs/sysutex/ex7.pp
Normal file
@ -0,0 +1,9 @@
|
||||
Program Example7;
|
||||
|
||||
{ This program demonstrates the DateToStr function }
|
||||
|
||||
Uses sysutils;
|
||||
|
||||
Begin
|
||||
Writeln(Format ('Today is: %s',[DateToStr(Date)]));
|
||||
End.
|
9
docs/sysutex/ex8.pp
Normal file
9
docs/sysutex/ex8.pp
Normal file
@ -0,0 +1,9 @@
|
||||
Program Example8;
|
||||
|
||||
{ This program demonstrates the DayOfWeek function }
|
||||
|
||||
Uses sysutils;
|
||||
|
||||
Begin
|
||||
Writeln ('Today''s day is ',LongDayNames[DayOfWeek(Date)]);
|
||||
End.
|
12
docs/sysutex/ex9.pp
Normal file
12
docs/sysutex/ex9.pp
Normal file
@ -0,0 +1,12 @@
|
||||
Program Example9;
|
||||
|
||||
{ This program demonstrates the DecodeDate function }
|
||||
|
||||
Uses sysutils;
|
||||
|
||||
Var YY,MM,DD : Word;
|
||||
|
||||
Begin
|
||||
DecodeDate(Date,YY,MM,DD);
|
||||
Writeln (Format ('Today is %d/%d/%d',[dd,mm,yy]));
|
||||
End.
|
Loading…
Reference in New Issue
Block a user