In a batch job, when you issue a
time /t
Windows NT returns hh:mm, as in 16:47.
If you type
time
at a command prompt, windows NT returns hh:mm:ss.hs, as in 16:47:03.20, but prompts for a new time.
If you need the more accurate time in a batch job, and your command processor isn't broken, use the following:
for /f "tokens=5-8 delims=:. " %%a in ('echo.^|time') do set thh=%%a&set tmm=%%b&set tss=%%c&set ths=%%dYou can then do whatever calculation required, using the set /a syntax, as in Time Math.
0 comments
Hide comments