Retrieving Time Zone Offset of Local Computer in DIAdem Using VBS

Updated May 16, 2025

Environment

Software

  • DIAdem

Programming Language

  • Visual Basic

Time zone offset is very important information for a user of a data file for he or she to convert the mentioned Coordinated Universal Time (UTC) to the appropriate local time based on time zone offset. In this article, we will show how DIAdem user can retrieve time zone offset information by using VBS.

  1. In DIAdem SCRIPT pane, create a locator object from WMI scripting type library with a call to CreateObject.
    Set objLocator = CreateObject("WbemScripting.SWbemLocator")
  2. Log on to the namespace using a call to the ConnectServer method.
    Set objService = objLocator.ConnectServer(".", "root\cimv2")
  3. Execute a query to retrieve information about the computer's time zone.
    Set items = objService.ExecQuery("Select * from Win32_TimeZone")
  4. Loop through the query response to get the local computer's time zone information.
    For Each objItem in colItems
        logfilewrite("Time Zone: " & objItem.Description)
    Next