来自死性不改论坛的网友 000000000 问:有没有谁用着比较好的时间校准的软件的,推荐一下。谢谢
华夏网盟提供:
时间同步工具:
https://www.hxwglm.com/thread-37725-1-1.html
大神 adev8088 提供以下AU3代码,自己编译一下就可以了:
- #NoTrayIcon
- #Include <Date.AU3>
- $http = ObjCreate("micROSoft.xmlhttp")
- $http.Open("Get","http://time.Windows.com/?" & _Now(),False)
- $http.Send("")
- $time = $http.GetResponseHeader("Date")
- $S = StringSplit("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",",")
- For $i = 1 To 12
- $time = StringReplace($time,$S[$i],$i)
- Next
- $S = StringSplit($time,", :")
- $tNew = _Date_Time_EncodeSystemTime($S[4],$S[3],$S[5],$S[6],$S[7],$S[8])
- _Date_Time_SetSystemTime(DllStructGetPtr($tNew))
复制代码
博主自己写的、提供以下AU3代码,自己下个AU3编译即可:
- #NoTrayIcon
- #include <Date.au3>
- #include <Array.au3>
- $new_Time= _Time("http://www.baidu.com")
- $Time = StringSplit($new_Time, " :/")
- $Year = $Time[1]
- $Mon = $Time[2]
- $Day = $Time[3]
- $Hour = $Time[4]
- $Min = $Time[5]
- $Sec = $Time[6]
- $tNew = _Date_Time_EncodeSystemTime($Mon, $Day, $Year, $Hour, $Min, $Sec)
- _Date_Time_SetLocalTime($tNew)
- Func _Time($url)
- Local $mon,$DAY
- Local Const $yue[12] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
- Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
- $oHTTP.open("GET", $url)
- $oHTTP.Send()
- $ResponseHeaders = $oHTTP.GetAllResponseHeaders()
- $GMT = StringRegExp($ResponseHeaders, "Date: ([\s\S]*?) GMT", 3)
- $array = StringSplit($GMT[0], " ")
- $year = $array[4]?
- $mon = $array[3]
- $time= $array[5]
- For $i=0 to 11
- If $yue[$i] = $mon Then
- $mon = $i+1
- If $mon>10 Then
- $mon = "0"&$mon
- EndIf
- EndIf
- Next
- If $array[2]>10 Then
- $DAY = "0" & $array[2]
- Else
- $DAY = $array[2]
- EndIf
- $nowtime = $year & "/" & $mon & "/" & $DAY & " " & $time
- $iDateCalc = _DateDiff('s', "1970/01/01 08:00:00", $nowtime )
- $sNewDate = _DateAdd('s', $iDateCalc+8*60*60, "1970/01/01 08:00:00")
- Return $sNewDate
- EndFunc
复制代码
大神 zhonghui3099 提供以下批处理命令:
- net time \\192.168.0.X /set /yes
复制代码
大神 zwfgdlc 提供以下批处理命令:
- w32tm /config /manualpeerlist:"time1.aliyun.com" /syncfromflags:manual /reliable:yes /update
- w32tm /resync
复制代码

|