[fpc-devel] FPC V3.0.0 LocalTimeToUniversal() error

Michael Van Canneyt michael at freepascal.org
Tue Jun 28 10:56:30 CEST 2016



On Tue, 28 Jun 2016, wkitty42 at windstream.net wrote:

> On 06/28/2016 03:18 AM, Michael Van Canneyt wrote:
>> On Tue, 28 Jun 2016, Russ Davies wrote:
> [...]
>>> Comparing dateutil.inc for both versions, in functions 
>>> UniversalTimeToLocal()
>>> and LocalTimeToUniversal() the signs of the offsets have been changed
>> 
>> Correct. This was in response to some bugreports. IMO the offset should be 
>> 120,
>> not -120.
>
> so GetLocalTimeOffset() is wrong and has been for a long time??

Nono. I spoke from (fuzzy) memory, but now I did some deeper investigation.

FPC 3.0 indeed contains a bug. This has meanwhile been fixed.

If I compile the program with trunk, I get:

home: >fpc tt.pp
home: >./tt
Offset     :-120
Local Time :10:53:16
UTC        :08:53:16
home: >date --utc
Tue Jun 28 08:53:25 UTC 2016
home: >date 
Tue Jun 28 10:53:29 CEST 2016

So the output is correct in trunk, and the bug has been fixed. 
I expect the fix to be in 3.0.2.

My apologies for the confusion.

Michael.



More information about the fpc-devel mailing list