I got a batch script with a block of code as:
@echo off
setlocal EnableDelayedExpansion
rem US locale, ie: 'Thu 12/02/2015'
for /F "tokens=2 delims=/ " %%m in ("%date%") do set /A "n=(3*((1%%m)%%100-1))"
echo %n%
pause
and while I was trying to understand it, I landed writing it myself as:
@echo off
setlocal EnableDelayedExpansion
rem US locale, ie: 'Thu 12/02/2015'
for /F "tokens=2 delims=/ " %%m in ("%date%") do set /A "n=3*(%%m-1)"
echo %n%
pause
Since both returns 33 as output, can anyone please help me understand the logic behind "n=(3*((1%%m)%%100-1))" and the difference between both the blocks.