|
楼主 |
发表于 2020-6-12 22:38
|
显示全部楼层
- Function getCurrentTime() '北京时间
- With CreateObject("Microsoft.XMLHTTP")
- .Open "HEAD", "https://www.baidu.com/", False
- .send
- t = .getResponseHeader("Date")
- End With
- getCurrentTime = CDate(Mid$(t, 6, 20)) + 1 / 3
- End Function
- Function getUTCTime() 'UTC时间
- With CreateObject("Microsoft.XMLHTTP")
- .Open "HEAD", "https://www.baidu.com/", False
- .send
- t = .getResponseHeader("Date")
- End With
- getUTCTime = CDate(Mid$(t, 6, 20))
- End Function
- Function getTimeZone() '获取系统时区
- With CreateObject("Microsoft.XMLHTTP")
- .Open "HEAD", "https://www.baidu.com/", False
- .send
- t = .getResponseHeader("Date")
- End With
- TimeZone = (Now - CDate(Mid$(t, 6, 20))) * 24
- If TimeZone > 0 Then gs = "+0" Else gs = "0"
- getTimeZone = Format(TimeZone, gs)
- End Function
- Function 获取当前系统时区()
- Set js = CreateObject("msscriptcontrol.scriptcontrol")
- js.Language = "javascript"
- js.addcode "function GetDate(){var js = new Date().getTimezoneOffset();return js;}"
- 获取当前系统时区 = js.eval("GetDate()") / 60
- End Function
复制代码 |
评分
-
1
查看全部评分
-
|