首先有两个推荐的方案. 一: for /f "tokens=2 delims==" %%a in ('wmic path win32_operatingsystem get LocalDateTime /value') do (set t=%%a) set Today=%t:~0,4%%t:~4,2%%t:~6,2%%t:~8,2%%t:~10,2% echo %Today% 二: if %time:~0,2% LEQ 9 (echo %date:~2,2%%date:~5,2%%da…
var date = new Date(); var year = date.getFullYear(); var month = date.getMonth()+1; var day = date.getDate(); var hour = date.getHours(); var minute = date.getMinutes(); var time = year + "-" + (month < 10 ? "0" + month : month) +…