-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTIME.PAS
40 lines (35 loc) · 896 Bytes
/
TIME.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ @author: Sylvain Maltais (support@gladir.com)
@created: 2022
@website(https://www.gladir.com/unicos-0)
@abstract(Target: Turbo Pascal, Free Pascal)
}
Program TIME;
Uses DOS;
Var
FirstParam:String;
Hour,Minute,Second,CentSec:Word;
Function PadZeroLeft(Value:Integer;Space:Byte):String;
Var
S:String;
Begin
Str(Value,S);
While Length(S)<Space do S:='0'+S;
PadZeroLeft:=S;
End;
BEGIN
FirstParam:=ParamStr(1);
If FirstParam='/?'Then Begin
WriteLn('TIME Cette commande permet de fixer ou de demander l''heure du systeme d''exploitation');
WriteLn;
WriteLn('Syntaxe:');
WriteLn;
WriteLn('TIME [/?]');
WriteLn;
WriteLn(' /? Ce parametre permet d''afficher l''aide sur cette commande');
End
Else
Begin
GetTime(Hour,Minute,Second,CentSec);
WriteLn('L''heure actuelle est ',Hour:2,':',PadZeroLeft(Minute,2),':',PadZeroLeft(Second,2),',',CentSec);
End;
END.