I wanted to make a duration calculation in a batch file and hav a problem with the modulo calculation. Examples on Websites always show one digit calculations like 14%%3 --> 2. To do a Modulo calculation with 60 or 3600 was always rejected. So I tried first a division and a modullo %%1 over the answer variable. But this was also denied. Anybody an idea how to proceed with situations like that?
Here is the code snipit:
set endzeit=Ende: %date% %time:~-11,2%:%time:~-8,2%:%time:~-5,2%
set /a ende=(%time:~-11,2%)*3600 + (%time:~-8,2%)*60 + (%time:~-5,2%)
set /a dauer=%ende%-%anfang%
set /a dauer_r=(%dauer%/3600)%%1
set /a dauer_sek=(%dauer_std_r%/60)%%1
set /a dauer_min=(%dauer_std_r%-%dauer_sek%)/60
set /a dauer_std=(%dauer%-%dauer_r%)/3600
echo %dauer_std%:%dauer_min%:%dauer_sek%