I have problem with convert %time% in for loop into seconds.
This is my script.
@Echo off
setlocal enabledelayedexpansion
set FilesDir=C:\
set FileName=lines.txt
IF EXIST !FileName! del /F !FileName!
FOR %%f IN (%FilesDir%*.*) DO (
Set StartTime=!time!
StartSomeApp.exe -f %%f
Set EndTime=!time!
set /A TimeOfExecutionInSeconds=!StartDate!-!EndDate!
Echo Started app with file %%f , TimeOfExecution: !TimeOfExecutionInSecond!
Echo Started app with file %%f , TimeOfExecution: !TimeOfExecutionInSecond!>>!FileName!
)
My intension is to get time execution of StartSomeApp.exe in seconds, what is the simplest way to convert StartDate and EndDate into seconds ?