你得到这样的格式
原文链接:https://www.f2er.com/windows/363810.htmlfor /f "tokens=1-4 delims=/ " %%i in ("%date%") do ( set dow=%%i set month=%%j set day=%%k set year=%%l ) set datestr=%month%_%day%_%year% echo datestr is %datestr%