赞
踩
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
获取电脑时间毫秒写法一:timer
t = timer
MsgBox t & vbcrlf & "现在时间是 " & Second2HNM(t)
Function Second2HNM(ABC)
Decimal = ABC - Int(ABC)
CK = ""
If Not ABC\60\60\24=0 Then CK = CK & (ABC\60\60\24)&"天"
If Not (ABC\60\60 mod 24)=0 Then CK = CK & (ABC\60\60 mod 24)&"小时"
If Not (ABC\60 Mod 60)=0 Then CK = CK & (ABC\60 Mod 60)&"分"
If Not (ABC mod 60)=0 Then CK = CK & (ABC mod 60)+Decimal & "秒"
Second2HNM = CK
End Function
获取电脑时间毫秒写法二:now、timer
t = timer
MilliSec= Round((t - Int(t))*1000,0)
MsgBox Now & ":" & MilliSec
获取电脑时间毫秒写法三:API
Private Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
lpSystemTime = "00000000"
GetLocalTime lpSystemTime
MessageBox Now & ":" & AscW(Right(lpSystemTime,1))
获取网络时间秒的写法
dim http,sdate
Set http = createobject("msxml2.XMLHTTP")
http.open "HEAD", "http://www.baidu.com"
http.send
sdate=http.getresponseheader("Date")
sdate = dateadd("h", 8, cdate(mid(sdate, 5, len(sdate) - 8)))
Set http = nothing
如何利用上述资源,把获取电脑时间毫秒改为获取网络时间毫秒
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。