Got more questions? Find advice on: ASP | SQL | XML | Regular Expressions
in Search
Welcome to WindowsAdvice Sign in | Join | Help

owsteve

Senior Internet Support Specialist @ ORCSWeb.com. Admin by day, wanna-be-coder @ night..

Create a unique variable on a batch file.

 

for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
for /f "tokens=1" %%u in ('time /t') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
set timestr=%d:~6,4%%d:~3,2%%d:~0,2%%t:~0,2%%t:~3,2%
echo %timestr%

Published Friday, March 03, 2006 12:51 PM by owsteve

Comments

No Comments
Anonymous comments are disabled