rem DOS get current time yyyy-mm-dd hhmiss week
rem =======================
rem get yyyy/mm/dd
set mydate=%DATE:~0,10%
echo %mydate%
rem =======================
rem get yyyy
set yyyy=%DATE:~0,4%
echo %yyyy%
rem =======================
rem get mm
set mm=%DATE:~5,2%
echo %mm%
rem =======================
rem get dd
set dd=%DATE:~8,2%
echo %dd%
rem =======================
rem get week ,display CN
set week=%DATE:~11,2%
rem or
set week1=%date:~-3%
echo %week% %week1%
rem or
rem =======================
rem get hour
set hh=%TIME:~0,2%
echo %hh%
rem =======================
rem get min
set mi=%TIME:~3,2%
echo %mi%
rem =======================
rem get ss
set ss=%TIME:~6,2%
echo %ss%
rem =======================
rem get yyyy-mm-dd
set curdate=%yyyy%-%mm%-%dd%_%hh%%mi%%ss%(%week%)
echo %curdate%
Dos下面取系统时间的方法
最新推荐文章于 2023-01-10 20:46:14 发布