批处理,生成当前时间

@echo %date%
@Set Year=%date:~0,4%
@Set Month=%date:~5,2%
@Set Day=%date:~8,2%

@Set CurrentDate=%Year%-%Month%-%Day%

@echo %CurrentDate%

pause

原文地址:https://www.cnblogs.com/krisy/p/3595484.html