批处理(bat)命令获得并格式化日期和时间
set d=%date:~0,10%
set d=%d:-=%
set d=%d: =0%
set t=%time:~0,8%
set t=%t::=%
set t=%t: =0%
echo "%p%%d%%t%"
pause
set d=%date:~0,10%
set d=%d:-=%
set d=%d: =0%
set t=%time:~0,8%
set t=%t::=%
set t=%t: =0%
echo "%p%%d%%t%"
pause