功能 获取百度时间()
变量 时间
变量 xmlHttp = com("Microsoft.XMLHTTP")
xmlHttp.open("GET", "http://open.baidu.com/", "False", "百度账号", "百度密码")
xmlHttp.send("getdatetime")
变量 DateTime=xmlHttp.getResp**eHeader("Date")
如果(字符串长度(DateTime)>0)
变量 Year = strsub(DateTime,12,16)
变量 Month = strsub(DateTime,8,11)
变量 Day = strsub(DateTime,5,7)
变量 Time = strsub(DateTime,17,25)
变量 Week = strsub(DateTime,0,3)
select(Month)
case "Jan"
Month = "01"
case "Feb"
Month = "02"
case "Mar"
Month = "03"
case "Apr"
Month = "04"
case "May"
Month = "05"
case "Jun"
Month = "06"
case "Jul"
Month = "07"
case "Aug"
Month = "08"
case "Sep"
Month = "09"
case "Oct"
Month = "10"
case "Nov"
Month = "11"
case "Dec"
Month = "12"
变量 Mpnth = "false"
结束
DateTime=timeadd("h",8,Year&"/"&Month&"/"&Day&" "&Time)
xmlHttp = null
变量 ArrNetTime = strreplace(strreplace(strreplace(DateTime,"/","|")," ","|"),":","|")
字符串分割(ArrNetTime,"|",ArrNetTime)
Year = ArrNetTime[0]
Month = ArrNetTime[1]
Day = ArrNetTime[2]
变量 Hour = ArrNetTime[3]
变量 Minute = ArrNetTime[4]
变量 Second = ArrNetTime[5]
if(strlen(Year)==1)
Year="0"&Year
结束
if(strlen(Month)==1)
Month="0"&Month
结束
if(strlen(Day)==1)
Day="0"&Day
结束
if(strlen(Hour)==1)
Hour="0"&Hour
结束
if(strlen(Minute)==1)
Minute="0"&Minute
结束
if(strlen(Second)==1)
Second="0"&Second
结束
消息框(Year&":"&Month&":"&Day)//时间格式可以自己修改
结束
结束 |