ycomp Posted April 26, 2008 Share Posted April 26, 2008 Hi, I'm using this code: Local $tzInfoArray = _Date_Time_GetTimeZoneInformation() MsgBox(0, "", $tzInfoArray[1]) In EST, I get a value of 300... which is minutes, so that is correct. If I switch to Amsterdam Time, I get 4294967236 instead of a negative number. I really need this negative number, how can I convert this unsigned value to a signed value? Link to comment Share on other sites More sharing options...
ProgAndy Posted April 26, 2008 Share Posted April 26, 2008 This should work:Functions found here: http://www.activevb.de/tipps/vb6tipps/tipp0557.htmlConst $OFFSET_4 = 4294967296 Const $MAXINT_4 = 2147483647 Const $OFFSET_2 = 65536 Const $MAXINT_2 = 32767 Func UnsignedToLong($value) If $Value < 0 Or $Value >= $OFFSET_4 Then Return SetError( 6) ;' Overflow If $Value <= $MAXINT_4 Then Return $Value Else Return $Value - $OFFSET_4 EndIf EndFunc Func LongToUnsigned($Value) If $Value < 0 Then Return $Value + $OFFSET_4 Else $LongToUnsigned = $Value EndIf EndFunc ;Example: 4294967236 -> -60 MsgBox(0, '', UnsignedToLong(4294967236)) *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
ycomp Posted April 26, 2008 Author Share Posted April 26, 2008 many thanks for the speedy and extremely helpful response! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now