如何用DOS命令的date命令获得当前日期的前一天

2024-11-17 05:52:30
推荐回答(2个)
回答(1):

@echo off
set DaysAgo=1
set Today=%date:~0,4%%date:~5,2%%date:~8,2%
set /a PassDays=%Today%-1
echo %PassDays%
pause

回答(2):

跨月或者跨年楼上就知道这方法有多坑