Skip to main content
NetworkAdminKB Logo

VBScript Library

Go Search
NetworkAdminKB.com
Knowledge Base
VBScript Library
Utilities
  
NetworkAdminKB.com > VBScript Library > Knowledge Base > Components > DateAndTime > DateTimeBias  

DateTimeBias

Article Content

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

'*

'* 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

Keywords
Date and Time Parts 
Related Articles
 
Last modified at 1/11/2009 7:50 PM  by TEMPLATE\kbadmin 
 
 NetworkAdminKB.com
 Copyright © 2008 NetworkAdminKB.com, All rights reserved. Terms of Use | Contact US