﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3265	_INetSmtpMail Bias calculation returns wrong values	Mulder	Jpm	"Its a very old bug ....

I always get mails dated 1h in the future.
Today i took the time to look into the problem an found out that Bias calc is faulty.

Instead of returning +0200 it does return +0100
and thats wrong for a MET timezone with DST
MET == UTC + 1h
DST == +1h

------code-------------
Func _INetSmtpMail($sSMTPServer, $sFr .......
old
    Local $aResult = _Date_Time_GetTimeZoneInformation()
    Local $iBias = -$aResult[1] / 60
    Local $iBiasH = Int($iBias)
    Local $iBiasM = 0
    If $iBiasH <> $iBias Then $iBiasM = Abs($iBias - $iBiasH) * 60
    $iBias = StringFormat("" (%+.2d%.2d)"", $iBiasH, $iBiasM)
new
    Local $aResult = _Date_Time_GetTimeZoneInformation()
    If @error Then
        TCPShutdown()
        Return SetError(5, 0, 0)
    EndIf
    Local $iBias = $aResult[1]
    If $aResult[0] = 2 Then $iBias += $aResult[7]
    $iBias *= -1
    Local $iBiasH = Int( $iBias / 60, 1 )
    Local $iBiasM = Mod( $iBias, 60 )
    $iBias = StringFormat("" (%+.2d%.2d)"", $iBiasH, $iBiasM) 

---------------
new error code 5
@ERROR = 5        -    Cannot get time zone information


$aResult[0] does show if the system is on DST
$aResult[1] does return the local offset from UTC in min
$aResult[7] does return the DST offset (always -60)

In a MET DST system
this would be
$aResult[0] = 2
$aResult[1] = -60
$aResult[7] = -60
http://www.timeanddate.com/worldclock/austria/vienna

On New York time it will be
$aResult[0] = 2
$aResult[1] = 300
$aResult[7] = -60
http://www.timeanddate.com/worldclock/usa/new-york

If the system is not on DST
$aResult[0] = 1

Tested on Win7, XPsp3

----test script-----------------
#include ""Date.au3""

Local $aResult = _Date_Time_GetTimeZoneInformation()
If @error Then
	TCPShutdown()
	Return SetError(5, 0, 0)
EndIf
Msgbox( 0, ""fixed bias"", $aResult[0] & @CRLF & $aResult[1] & @CRLF & $aResult[7] )
Local $iBias = $aResult[1]
If $aResult[0] = 2 Then $iBias += $aResult[7]
$iBias *= -1
Local $iBiasH = Int( $iBias / 60, 1 )
Local $iBiasM = Mod( $iBias, 60 )
$iBias = StringFormat("" (%+.2d%.2d)"", $iBiasH, $iBiasM)

msgbox(0,"""",$iBias)
"	Bug	closed	3.3.15.1	Standard UDFs	Other	None	Fixed	_INetSmtpMail	
