batch: time to var

For /f "tokens=2-3 delims=: " %%a in ('time /t') do (set time2=%%a-%%b) this is what i do to obtain the time in hh-mm for naming a filebut i also need to get the seconds in time ie: hh-mm-ssis there a way to do this?

hello Klint & M2!On my old funky clunker, time /t only yields the hours and minutes, and i'm toodumb/lazy to go into registry and fix the time format, which is probably the sourceof the problem, so i did this:for /f "tokens=5-7 delims=:. " %%a in ('echo. ^|time') do set s=%%a-%%b-%%c

(time without /t gives the seconds and hundredths)you could add a "skip=1" if you want to be anal about it, but why bother?

The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Compnet Ventures, LLC hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.