批处理生成指定格式的日期时间字符串

@echo off
set /a tm1=%time:~0,2%*1
if %tm1% LSS 10 set tm1=0%tm1%
echo %date:~0,4%%date:~5,2%%date:~8,2%%tm1%%tm2%%tm3%%time:~3,2%%time:~6,2%
pause

结果:
20120710191105

以上内容根据网络整理而得,方便学习查阅

posted @ 2013-03-18 11:55  liancs  阅读(419)  评论(0编辑  收藏  举报