Friday, January 6, 2017

Creating an output file with date and timestamp from the command prompt

Here's a quick and easy way to create a timestamp when outputting from the command prompt:

myscript.bat > myscript_%date:~-4%-%date:~4,2%-%date:~7,2%_%time:~0,2%_%time:~3,2%_%time:~6,2%.log


No comments: