There is certainly a big difference between using an INTEGER rather than an _OFFSET as a function's parameter. Also, notice that Petr's method treats GetTimeZoneInformation as a SUB rather than a FUNCTION.
Why does Petr's method work in that it returns a correct value for the time zone Bias value?
Title: Re: Calling the GetTimeZoneInformation function in QB64
Post by: EricE on March 29, 2020, 01:23:18 am
I have the answer. The Time Zone Bias INTEGER value (it really should be a LONG) that is returned is correct because it is the first field in the Time Zone structure and the value fits in an INTEGER. All the other fields don't make it out of the call to the GetTimeZoneInformation function and are lost.
Here is my debug code, if anyone wants to see it. I changed the GetTimeZoneInformation parameter from an INTEGER which it was in Petr's code to a fixed string type, STRING*1000 to make room for the returned data.