i am using the following to set the date/time to something more readable:
set day=%date:~4,2%
set mth=%date:~7,2%
set yr=%date:~10,4%
set hur=%time:~0,2%
set
set "day=%date:~4,2%"
set "mth=%date:~7,2%"
set "yr=%date:~10,4%"
set "_time=0%time%"
set "hur=%_time:~-11,2%"
set "min=%_time:~-8,2%"
set bdate=[%day%-%mth%-%yr%]-[%hur%-%min%]
You can pad time
with a 0
and then do the substitution from the right side using negative numbers as the start position of the string. 1:00
would become 01-00
to match the pattern of HH-MM
.