日期:2014-05-17 浏览次数:20893 次
@echo off
setlocal enabledelayedexpansion
set year=%date:~0,4%
set month=%date:~5,2%
set day=%date:~8,2%
echo %year%%month%%day%
if %day% EQU 01 (set last_day=30 & set/a last_month=%month%-1 &echo %year%!last_month!!last_day!) else (set/a last_day=%day%-1 & set last_month=%month% & echo %year%!
last_month!!last_day!)
pause