bat批处理-取年、月、日、时、分、秒、毫秒
星期六 2016年11月5日 王佳明 技术 bat 0人
取年份:echo %date:~0,4%
取月份:echo %date:~5,2%
取日期:echo %date:~8,2%
取星期:echo %date:~10,6%
取小时:echo %time:~0,2%
取分钟:echo %time:~3,2%
取秒:echo %time:~6,2%
取毫秒:echo %time:~9,2%
echo BAK%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%
得到的就是:
BAK2016110512354001 这个样子
本站内容多数为佳明one原创,少量转载自网络。
- 本文标题:bat批处理-取年、月、日、时、分、秒、毫秒
- 本文地址:https://itjm.com/2016/11/711.html
