'********************************************************************

'*

'* Function DateTimeBias

'*

'*   Author: NetworkAdminKB.com

'*  Created: 2006-01-13

'* Modified: 2006-01-13

'*

'* Purpose: Returns the local Time Zone bias in seconds for the local

'*            computer.

'*

'*   Input: None

'*

'*  Output: Returns the local Time Zone bias from the local computer.

'*            The value returned is of type Long.

'*

'*   Notes: The ActiveTimeBias setting accounts for daylight savings

'*            time as well.  The time zone setting is stored as HEX in the

'*            registry but is automatically converted to the proper decimal values

'*            by the RegRead function.  In the registry the format is a follows.

'*            Positive numbers in multiples of 60 minutes (60, 120, etc.)

'*            represent GMT-X time zones.  GMT+X time zones are represented

'*            as HEX complements (0xFFFFFFC4, etc) that are off by one (ie.

'*            0xFFFFFFFF - 0xFFFFFFC4 = 0x3B = 59 seconds) which RegRead will

'*            return as -60.

'*

'********************************************************************

Function DateTimeBias

  'Version: 1.0 2006-01-13

  Dim objShell

 

  Set objShell = CreateObject("Wscript.Shell")

  DateTimeBias = objShell.RegRead("HKLM\System\CurrentControlSet\Control\" & _

                                  "TimeZoneInformation\ActiveTimeBias")

  Set objShell = Nothing

End Function 'DateTimeBias

Article ID: 381, Created On: 9/25/2011, Modified: 9/25/2011