I am using the following simple line in my windows batch file to get the current time stamp to a String format so that I can use it later in the batch file to create a folder with same name.
set TIME_STAMP=%DATE:/=-%_%TIME::=-%
I observed that when the time is single digits, say 9:31 AM, I get the String like this:
08-10-2015_ 9.31.52.57
Notice the space between the characters _ and 9. When the system time is say 10:31 AM, it all works fine, like
08-10-2015_10.31.52.57
Is there something I can do to make the time stamp as
08-10-2015_09.31.52.57
when I have hours in single digits?