Need leading zero for batch script using %time% variable
- by Ira
Hi, I came across a bug in my DOS script that uses date and time data for file naming. The problem was I ended up with a gap because the time variable didn't automatically provide leading zero for hour < 10. So running echo %time% gives back: ' 9:29:17.88'.
Does anyone know of a way to conditionally pad leading zeros to fix this?
More info:…