回复 1# gd6570 - @echo off
- set /p n=请输入要累加的秒数:
- >gettime.vbs echo dim t,h,m,s
- >>gettime.vbs echo t=Hour(Now)*3600+Minute(Now)*60+Second(Now)+%n%
- >>gettime.vbs echo h=t\3600
- >>gettime.vbs echo m=(t mod 3600)\60
- >>gettime.vbs echo s=(t mod 3600) mod 60
- >>gettime.vbs echo if (h^<10) then h="0"^&h
- >>gettime.vbs echo if (m^<10) then m="0"^&m
- >>gettime.vbs echo if (s^<10) then s="0"^&s
- >>gettime.vbs echo wscript.echo h^&":"^&m^&":"^&s
- for /f %%a in ('cscript /nologo gettime.vbs') do (set "gtime=%%a")
- del gettime.vbs /f /q
- echo 当前时间为%time:~0,8%
- echo 累加%n%秒后的时间为%gtime%
- pause
复制代码
|