cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joychen
Level 2

How to get server time zone?

Hi, I am now making an installer which needs to provide the UI for user input a server IP. And the request is to check the server time zone if is consistent with the local time zone.
How can I do that?
Labels (1)
0 Kudos
(2) Replies
CHANDINATHREDDY
Level 7

hi you can write an custom action to retrive the time zone and then use it for further use.



Dim oWMIService, oComputer, colComputer

Dim strComputer
strComputer = “.”
Set oWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\\” _
& strComputer & “\root\cimv2″)
Set colComputer = oWMIService.ExecQuery _
(“Select * from Win32_TimeZone”)
For Each oComputer in colComputer
msgbox oComputer.Description
Exit For
Next
Set oComputer = Nothing
Set colComputer = Nothing
Set oWMIService = Nothing
0 Kudos
joychen
Level 2

CHANDINATHREDDY wrote:
hi you can write an custom action to retrive the time zone and then use it for further use.



Dim oWMIService, oComputer, colComputer

Dim strComputer
strComputer = “.”
Set oWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\\” _
& strComputer & “\root\cimv2″)
Set colComputer = oWMIService.ExecQuery _
(“Select * from Win32_TimeZone”)
For Each oComputer in colComputer
msgbox oComputer.Description
Exit For
Next
Set oComputer = Nothing
Set colComputer = Nothing
Set oWMIService = Nothing


Is it using a vbs? How can I reference it?
0 Kudos