欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時間:2011年02月03日 15:29:58   作者:  
WMI中的DateTime數(shù)據(jù)類型保存的時間格式是UTC,與VBS中的時間類型不同。
有兩種方法可以轉(zhuǎn)換,一種是自己寫個函數(shù)解析:
復(fù)制代碼 代碼如下:

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對象
復(fù)制代碼 代碼如下:

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

相關(guān)文章

最新評論