本帖最后由 风行者 于 2010-6-30 15:46 编辑 MsgBox(0,"",_Hdate())
Func _Hdate()
Local $oHTTP,$H_time,$str,$Date
Local $mon[13]=[12,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
$oHTTP = ObjCreate("microsoft.xmlhttp")
$oHTTP.Open("get","http://v.time.org.cn/com/",false)
$oHTTP.setRequestHeader("ver", "1.2")
$oHTTP.Send()
$str = StringTrimLeft($oHTTP.getResponseHeader("Date"),4)
For $i = 1 To 12
$str = StringReplace($str,$mon[$i],$i)
Next
$str = StringSplit($str," ")
$H_time = StringLeft($str[5],2) + 8
If $H_time >=24 Then $H_time -= 24
$H_time &= StringTrimLeft($str[5],2)
$Date = $str[4]&"-"&$str[3]&"-"&$str[2]&" "&$H_time
Return $Date
EndFunc
|