|
楼主 |
发表于 2019-1-8 12:41
|
显示全部楼层
本帖最后由 YZC51 于 2019-2-3 14:23 编辑
Function TimeBJ(Optional ByVal num As Integer = 0) '网络时间
arr = Split("北京,纽约,堪培拉,巴黎,东京,莫斯科,伦敦", ",")
On Error Resume Next
Application.Volatile
Dim http
URL = "http://www.24timemap.com/"
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", URL, False
.send
If .ReadyState <> 4 Then
Exit Function
End If
st = .responseText
End With
a = Split(st, "tzone(")
TimeBJ = arr(num) & Format(Left(a(num + 2), 10) / 86400 + 25569 + 1 / 3, "时间 yyyy-mm-dd hh:mm:ss")
If num = 5 Then TimeBJ = arr(num) & Format(Left(a(num + 2), 10) / 86400 + 25569 + 1 / 8, "时间 yyyy-mm-dd hh:mm:ss")
End Function
|
评分
-
2
查看全部评分
-
|