C:\>echo %date%
2016
/06/20
周一
C:\>echo %date:~0,4%
2016
C:\>echo %date:~5,2%
06
C:\>echo %date:~8,2%
20
C:\>echo %time%
15:29:13.63
C:\>echo %time:~0,2%
15
C:\>echo %time:~3,2%
29
C:\>echo %time:~6,2%
54
[THE END]
C:\>echo %date%
2016
/06/20
周一
C:\>echo %date:~0,4%
2016
C:\>echo %date:~5,2%
06
C:\>echo %date:~8,2%
20
C:\>echo %time%
15:29:13.63
C:\>echo %time:~0,2%
15
C:\>echo %time:~3,2%
29
C:\>echo %time:~6,2%
54
[THE END]
转载于:https://www.cnblogs.com/configure/p/6053416.html