for /F \"tokens=1-4 delims=/ \" %%i in (\'date /t\') do (
set Day=%%k
set Month=%%j
set Year=%%l
set DATE=%%k/%%j/%%l)
I am try to get the date int
This is what I'd use in an XP pro machine and higher. XP Home does not have wmic.
:: timestamp YYYYMMDD_HHMMSS
@echo off
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a
set dt=%dt:~0,8%_%dt:~8,6%
echo %dt%
pause
and another
:: timestamp YYYY-MM-DD_HH-MM-SS
@echo off
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a
set dt=%dt:~0,4%-%dt:~4,2%-%dt:~6,2%_%dt:~8,2%-%dt:~10,2%-%dt:~12,2%
echo %dt%
pause