- Ìû×Ó
- 187
- »ý·Ö
- 539
- ¼¼Êõ
- 4
- ¾èÖú
- 0
- ×¢²áʱ¼ä
- 2009-1-24
|
ÎÒÒ²½è¼øÀ´Ð´¸ö£º
Function Set_Net_DateTime()
Dim attrib,day,month,year,hours
'On Error Resume Next
attrib=Split(getHTTPPage("http://stdtime.gov.hk:13"))'30 JAN 2012 00:04:42 HKT
day=attrib(0)
month=int(instr("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC",attrib(1))/3)+1
year=attrib(2)
hours=attrib(3)
Set objSWbemDateTime=CreateObject("WbemScripting.SWbemDateTime")
objSWbemDateTime.SetVarDate year&"-"&month&"-"&day&" "&attrib(3),True '"2009-3-30 22:38:00"
Set objWMIService=GetObject("winmgmts:{(Systemtime)}\\.\root\cimv2")
Set colOSes=objWMIService.ExecQuery("Select * From Win32_OperatingSystem")
For Each objOS In colOSes
objOS.SetDateTime objSWbemDateTime.Value
Next
Set objSWbemDateTime=nothing
set objWMIService=nothing
set colOSes=nothing
End Function |
|