实例一:
@echo off
set /p var=
echo %var%|findstr /be [0-9.]* >nul && echo Yes||echo No
pause
实例二:
set datevar=%date:~0,4%-%date:~5,2%-%date:~8,2%
set timevar=%time:~0,2%
if /i %timevar% LSS 10 (set timevar=0%time:~1,1%)
set timevar=%timevar%-%time:~3,2%-%time:~6,2%
set datetime=%datevar%_%timevar%