def GetLocalTimeZone():
 tzRegKey = 'SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation'
 key = _winreg.OpenKeyEx(_winreg.HKEY_LOCAL_MACHINE, tzRegKey)
 local = _RegKeyDict(key)
 fixStandardTime = ((local['StandardName'] == local['DaylightName']) and (local['StandardBias'] == local['DaylightBias']))
 keyName = ['StandardName', 'TimeZoneKeyName'][(sys.getwindowsversion() >= (6,))]
 standardName = local[keyName]
 standardName = __TimeZoneKeyNameWorkaround(standardName)
 return TimeZoneInfo(standardName, fixStandardTime)

def GetLocalTimeZone ( ) : tzRegKey = 'SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation' key = _winreg . OpenKeyEx ( _winreg . HKEY_LOCAL_MACHINE , tzRegKey ) local = _RegKeyDict ( key ) fixStandardTime = ( ( local [ 'StandardName' ] == local [ 'DaylightName' ] ) and ( local [ 'StandardBias' ] == local [ 'DaylightBias' ] ) ) keyName = [ 'StandardName' , 'TimeZoneKeyName' ] [ ( sys . getwindowsversion ( ) >= ( 6 , ) ) ] standardName = local [ keyName ] standardName = __TimeZoneKeyNameWorkaround ( standardName ) return TimeZoneInfo ( standardName , fixStandardTime )
returns the local time zone as defined by the operating system in the registry .