网吧服务器/网吧收费机/网吧客户机 同步时间的问题 众多解决方法和软件
来自死性不改论坛的网友 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,$S,$S,$S,$S,$S)
_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
$Mon = $Time
$Day = $Time
$Hour = $Time
$Min = $Time
$Sec = $Time
$tNew = _Date_Time_EncodeSystemTime($Mon, $Day, $Year, $Hour, $Min, $Sec)
_Date_Time_SetLocalTime($tNew)
Func _Time($url)
Local $mon,$DAY
Local Const $yue = ["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, " ")
$year = $array?
$mon = $array
$time= $array
For $i=0to 11
If $yue[$i] = $mon Then
$mon = $i+1
If $mon>10 Then
$mon = "0"&$mon
EndIf
EndIf
Next
If $array>10 Then
$DAY = "0" & $array
Else
$DAY = $array
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
非常感谢 膜拜大神3秒钟 {author} 感谢楼主分享 支持,顶一下。
页:
[1]