获取系统日期:
%date%
获取系统时间:
%time%
修改时间连接符号
%date:~0,4%.%date:~5,2%.%date:~8,2%.%time:~0,2%.%time:~3,2%.%time:~6,2%%time:~8,3%
批处理参数传递
set "T=%date:~0,4%.%date:~5,2%.%date:~8,2%.%time:~0,2%.%time:~3,2%.%time:~6,2%%time:~8,3%"
输出参数T
echo %T%
示例:
C:\Users\Administrator>set "T=%date:~0,4%.%date:~5,2%.%date:~8,2%.%time:~0,2%.%t
ime:~3,2%.%time:~6,2%%time:~8,3%"
C:\Users\Administrator>echo %T%
2021.06.10.16.30.54.52
C:\Users\Administrator>
分类:Commands
标签:
评论已关闭!