bat获取明天日期
程序员文章站
2022-05-01 12:42:58
...
echo Wscript.echo dateadd("d",1,date)>vbs.vbs
for /f %%a in ('cscript /nologo vbs.vbs') do del vbs.vbs&&set yyyymmdd=%%a
for /f "tokens=1,2,3* delims=// " %%i in ('echo %yyyymmdd%') do set yyyy=%%i&set mm=%%j&set dd=%%k
if %mm% LSS 9 set mm=0%mm%
if %dd% LSS 9 set dd=0%dd%
set tomorrow=%yyyy%-%mm%-%dd%
echo tomorrow is : %tomorrow%
如果要在CMD里逐行执行要把%%改成%
echo Wscript.echo dateadd("d",1,date)>vbs.vbs
for /f %a in ('cscript /nologo vbs.vbs') do del vbs.vbs&&set yyyymmdd=%a
for /f "tokens=1,2,3* delims=// " %i in ('echo %yyyymmdd%') do set yyyy=%i&set mm=%j&set dd=%k
if %mm% LSS 9 set mm=0%mm%
if %dd% LSS 9 set dd=0%dd%
set tomorrow=%yyyy%-%mm%-%dd%
echo tomorrow is : %tomorrow%
上一篇: css解决高度自适应问题(使用flex)
下一篇: 论文实现:处理数据之生成batch