Sub 获取北京时间1()
On Error Resume Next
Set oDoc = CreateObject("htmlfile")
With CreateObject("Microsoft.XMLHTTP")
.Open "GET", "http://www., False
.send
tt = Split(.responsetext, ";")
MsgBox Split(tt(5), "=")(1) & ":" & Split(tt(6), "=")(1) & ":" & Split(tt(7), "=")(1)
End With
End Sub
Sub 获取北京时间2()
' 北京时间
On Error Resume Next
With CreateObject("internetexplorer.application")
.Visible = False
.Navigate "http://open.baidu.com/special/time/"
Do Until .ReadyState = 4
DoEvents
Loop
For Each linkels In .document.getElementsByName("time")
stime = Mid(linkels.outerHTML, 16, 8)
secstime = CInt(Right(stime, 2))
minstime = CInt(Mid(stime, 4, 2))
houstime = CInt(Left(stime, 2))
MsgBox houstime & ":" & minstime & ":" & secstime
Next
.Quit
End With
End Sub
Sub 获取北京时间3()
On Error Resume Next
With CreateObject("Microsoft.XMLDOM")
.async = False
.Load "http://www.time.
Set cnd = .DocumentElement.ChildNodes(0).ChildNodes
MsgBox cnd(4).Text & ":" & cnd(5).Text & ":" & cnd(6).Text
End With
End Sub