set TodayYear=%date:~0,4%
set TodayMon=%date:~5,2%
set TodayDay=%date:~8,2%
echo %TodayDay%
pause
set LastdayYear=
set LastdayMon=
set LastdayDay=
set LastdayYear=%TodayYear%
set LastdayMon=%TodayMon%
set /A LastdayDay=TodayDay-1
echo %LastdayDay%
pause
为什么我1日岛7日,都显示正常,今天开始最后一个变成了-1,把电脑时间调成9月9日夜市-1,调成9月10日,又正常了。
加一行就行了
@echo off
set TodayYear=%date:~0,4%
set TodayMon=%date:~5,2%
set TodayDay=%date:~8,2%
for %%a in (08 09) do if %TodayDay%==%%a set TodayDay=%date:~9,1%
echo %TodayDay%
pause
set LastdayYear=
set LastdayMon=
set LastdayDay=
set LastdayYear=%TodayYear%
set LastdayMon=%TodayMon%
set /A LastdayDay=TodayDay-1
echo %LastdayDay%
pause
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息