mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 00:28:24 +02:00
24 lines
340 B
ObjectPascal
24 lines
340 B
ObjectPascal
Program Example3;
|
|
uses Dos;
|
|
|
|
{ Program to demonstrate the GetTime function. }
|
|
|
|
Function L0(w:word):string;
|
|
var
|
|
s : string;
|
|
begin
|
|
Str(w,s);
|
|
if w<10 then
|
|
L0:='0'+s
|
|
else
|
|
L0:=s;
|
|
end;
|
|
|
|
var
|
|
Hour,Min,Sec,HSec : word;
|
|
begin
|
|
GetTime(Hour,Min,Sec,HSec);
|
|
WriteLn('Current time');
|
|
WriteLn(L0(Hour),':',L0(Min),':',L0(Sec));
|
|
end.
|