salt-master 获取windows 时间

 获取天

@set today=%Date:~3,4%%Date:~8,2%%Date:~11,2%

获取当下时间

@set "now=%Date:~3,4%%Date:~8,2%%Date:~11,2%%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%"

由于直接CMD下和 salt 远程执行 bat 不一致:

cmd 下直接获取 ( 和 salt 执行不一样 )

@set "now=%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%"

 




posted @ 2019-12-27 16:53  01234567  阅读(163)  评论(0编辑  收藏  举报