1.取得时间戳
@echo off set date0=%date:~0,10% set hour0=%time:~0,2% set time0=%time:~0,2%%time:~3,2%%time:~6,2% if %hour0% lss 10 set set time0=%time:~1,7% if %hour0% gtr 9 set set time0=%time:~0,8% set dttm=%date0:-=%%time0::=% echo %dttm%
1.取得时间戳
@echo off set date0=%date:~0,10% set hour0=%time:~0,2% set time0=%time:~0,2%%time:~3,2%%time:~6,2% if %hour0% lss 10 set set time0=%time:~1,7% if %hour0% gtr 9 set set time0=%time:~0,8% set dttm=%date0:-=%%time0::=% echo %dttm%
转载于:https://www.cnblogs.com/kreo/p/5056334.html