set now DATE TIME for tokens 1-7 delims in now do set datatime

1
2
3
4
5
set now=%DATE: =0% %TIME: =0%
for /f "tokens=1-7 delims=/-:., " %%a in ("%now%") do (
set datatime=%%c%%b%%a%%d%%e
)