在论坛上找到了一段代码是获取网络时间的..afan大大写的..如何让它动态显示在输入框内呢..2011-08-21 10:40:13下一秒就改成2011-08-21 10:40:14..这样一真下去..MsgBox(0, '', _Hdate())
Func _Hdate()
Local $mon = 'Jan01Feb02Mar03Apr04May05Jun06Jul07Aug08Sep09Oct10Nov11Dec12'
Local $Wday = 'Sun日Mon一Tue二Wed三Thu四Fri五Sat六'
$oHTTP = ObjCreate('microsoft.xmlhttp')
$oHTTP.Open('get', 'http://v.time.org.cn/com/', False)
$oHTTP.Send()
Local $sR = StringRegExp($oHTTP.getResponseHeader('Date'), '(.+?),\h(\d+)\h(.+?)\h(\d{4})\h(\d+)(.+?)\h', 3)
If @error Then Return SetError(1, 0, -1)
Local $_mon = StringRegExpReplace($mon, '.*' & $sR[2] & '(\d+).*', '$1')
Local $_Wday = StringRegExpReplace($Wday, '.*' & $sR[0] & '(.).*', '$1')
Local $H_time = $sR[4] + 8
If $H_time >= 24 Then $H_time -= 24
Return $sR[3] & '-' & $_mon & '-' & $sR[1] & ' ' & $H_time & $sR[5] & ' 星期' & $_Wday
EndFunc ;==>_Hdate
|