国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

將WMI中的DateTime類型轉(zhuǎn)換成VBS時間的函數(shù)代碼

2020-07-26 11:51:04
字體:
供稿:網(wǎng)友
有兩種方法可以轉(zhuǎn)換,一種是自己寫個函數(shù)解析:
復制代碼 代碼如下:

Function WMIDateStringToDate(DateTime)
WMIDateStringToDate = _
CDate(Mid(DateTime, 5, 2) &_
"/" &_
Mid(DateTime, 7, 2) &_
"/" &_
Left(DateTime, 4) &_
" " &_
Mid (DateTime, 9, 2) &_
":" &_
Mid(DateTime, 11, 2) &_
":" &_
Mid(DateTime, 13, 2))
End Function

另一種是使用SWbemDateTime對象
復制代碼 代碼如下:

Function WMIDateStringToDate(DateTime)
Set WbemDateTime = _
CreateObject("WbemScripting.SWbemDateTime")
WbemDateTime.Value = DateTime
WMIDateStringToDate = WbemDateTime.GetVarDate()
End Function

參考鏈接:It's About Time (Oh, and About Dates, Too)
原文:http://demon.tw/programming/wmi-datetime-vbs.html

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 云和县| 英德市| 健康| 茶陵县| 息烽县| 锦州市| 古田县| 宿松县| 南靖县| 济宁市| 庆安县| 和静县| 集安市| 广灵县| 仁化县| 麻城市| 昭觉县| 丰都县| 山阳县| 昌江| 沙雅县| 安丘市| 梅河口市| 徐州市| 台北县| 德安县| 郁南县| 曲松县| 阿图什市| 绥中县| 黄石市| 陵水| 贵州省| 瑞昌市| 原平市| 万山特区| 东丽区| 南和县| 贵溪市| 安龙县| 黔江区|