@echo off rem BAT获取系统日期,时间,并去掉时间小时前面的空格和时间后面的空格 echo *** %DATE% echo *** %TIME% set THISDATE=%DATE:~0,4%%DATE:~5,2%%DATE:~8,2% echo %THISDATE% rem 去掉小时前的空格 set h=%time:~0,2% set h=%h: =0% set log_filename=%date:~0,4%%date:~5,2%%date:~8,2%%h%%time:~3,