租号玩代理申请
A-A+

网吧服务器/网吧收费机/网吧客户机 同步时间的问题 众多解决方法和软件

2020年11月26日 问题教程 暂无评论 阅读 228 次

来自死性不改论坛的网友 000000000 问:有没有谁用着比较好的时间校准的软件的,推荐一下。谢谢

大神 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))

大神 wmmjwqf 直接提供以下软件下载:

https://www.yweihu.com/post/46.html

大神 shykx 提供以下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

转自:http://www.clxp.net.cn/thread-19139-1-1.html

京东空调大促销