Skip to content

Commit 65dc3df

Browse files
committed
Improved Batch
1 parent ed4b008 commit 65dc3df

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

batch/clockhands.bat

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@ FOR /L %%i IN (0, 1, 10) DO CALL :FOO %%i
33
GOTO :END
44

55
:FOO
6-
SETLOCAL ENABLEDELAYEDEXPANSION
76
SET /A t=(43200 * %1 + 21600) / 11
87
SET /A h=%t% / 3600
98
SET /A m=%t% / 60 %% 60
109
SET /A s=%t% %% 60
1110
IF %h% EQU 0 SET h=12
12-
SET h=0%h%
13-
SET m=0%m%
14-
SET s=0%s%
15-
SET h=!h:~-2!
16-
SET m=!m:~-2!
17-
SET s=!s:~-2!
11+
IF %h% LSS 10 SET h=0%h%
12+
IF %m% LSS 10 SET m=0%m%
13+
IF %s% LSS 10 SET s=0%s%
1814
ECHO %h%:%m%:%s%
19-
ENDLOCAL
2015
:END

0 commit comments

Comments
 (0)