i have a script it is able to append in this style
@ECHO OFF
set datetime=%date:~0,4%-%date:~8,2%-%date:~0,2%_%time:~0,2%%time:~3,2%%time:~6,2%
set datetime=%datetime: =0%
echo hello >>%datetime%.txt
EXIT
It will output like this "2020-17-20_104919.txt"if you don't want the second just modify like this
set datetime=%date:~0,4%-%date:~8,2%-%date:~0,2%_%time:~0,2%%time:~3,2%%time:~4,0%
Resource:
https://stackoverflow.com/questions/1192476/format-date-and-time-in-a-windows-batch-script
No comments:
Post a Comment