本帖最后由 apang 于 2015-4-16 21:18 编辑
- @echo off
- (for /f %%a in ('wmic os get CurrentTimeZone^|findstr [0-9]') do (
- echo,Set dt=CreateObject("WbemScripting.SWbemDateTime"^)
- echo,dt.SetVarDate DateAdd("n",-%%a,Now^), true
- echo,WScript.Echo dt.Value
- ))>$
-
- for /f "delims=." %%a in ('cscript -nologo -e:vbs $') do set "d=%%a"
- echo,%d:~,4%-%d:~4,2%-%d:~6,2% %d:~8,2%:%d:~10,2%:%d:~-2%
- pause
复制代码
|