I've created a timestamp variable in a batch script like so...
set TIMESTAMP=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%-%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%
There is an issue though when the HH is only a single digit I get...
YYYY-MM-DD- 2-MM-SS
instead of
YYYY-MM-DD-02-MM-SS
How do I consistently generate the timestamp without spaces?