|
楼主 |
发表于 2010-9-24 14:27
|
显示全部楼层
Dim objXML As Object
Dim strTemp As String
Dim lStart As Long
Dim lEnd As Long
Dim DtWeb As Date
Dim arr
Set objXML = CreateObject("Microsoft.XMLHTTP")
Randomize '初始化随机数,避免IE缓存重复
objXML.Open "Get", "http://www.timeanddate.com/worldclock/city.html?n=33&Refresh=" & Rnd, False
objXML.sEnd ""
strTemp = objXML.responseText
Set objXML = Nothing
lStart = InStr(1, strTemp, "Current Time", vbTextCompare)
lEnd = InStr(lStart, strTemp, "</strong>", vbTextCompare)
strTemp = Mid(strTemp, lStart, lEnd - lStart)
strTemp = Replace(strTemp, "Current Time</th><td><strong id=ct class=big>", "")
arr = Split(strTemp, ",")
网络时间= CDate(arr(1) & arr(2)) |
|