Solved if condition for date and time

October 22, 2020 at 02:27:41
Specs: Windows 10
@echo off
for /f "tokens=2 delims=|" %%a in (out.txt) do (
set datevar=%%a
goto :done
)
:done
echo %datevar%
for /f "tokens=2 delims=|" %%a in (in.txt) do (
set local=%%a
goto :done
)
:done

echo %local%
IF %datevar% GTR %local% (
echo "source"
) else (
echo "local"
)

getting below output error
2020/10/18 06:15:00
2020/10/08 06:15:00
06:15:00 was unexpected at this time.


See More: if condition for date and time


#1
October 22, 2020 at 03:51:11
✔ Best Answer
IF "%datevar%" GTR "%local%" (

=====================

M2


Reply ↓  Report •
Related Solutions


Ask Question