Link to home
Start Free TrialLog in
Avatar of Randy Johnson
Randy JohnsonFlag for United States of America

asked on

Script Time Question Leading 0

Hello,

SET t1=%TIME:~0,2%
SET t2=%TIME:~3,2%
SET t3=%TIME:~6,4%
SET g1=%DATE:~4,2%
SET g2=%DATE:~7,2%
SET g3=%DATE:~10,4%


I use the above to get the time into chunks.

and them in a file.

move  myFile.txt    myFile-%g1%_%g2%_%g3%-%t1%_%t2%_%t3%.txt

It works fine as long as there is a 2 digit hour such as 10 11 or 12

If it is 7AM  how can I get the hour above to have a leading 0?   such as 07  instead of just 7

T1 above is what holds the hour.


Thanks!

Randy
ASKER CERTIFIED SOLUTION
Avatar of vsg375
vsg375

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Randy Johnson

ASKER

Thanks man,  This is an awesome utility