UniversalTimeToLocal(UT: TDateTime) / LocalTimeToUniversal(LT: TDateTime)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

UniversalTimeToLocal(UT: TDateTime) / LocalTimeToUniversal(LT: TDateTime)

Michael Van Ham
Hello FreePascal developers,


I believe that since SVN commit 30628 UniversalTimeToLocal(UT: TDateTime) and LocalTimeToUniversal(LT: TDateTime) are reporting incorrect values.

The multiple parameter versions of these functions had their offset handling changed to a more expected format as described in bug id 24752 [1].

The single parameter versions call GetLocalTimeOffset, which ultimately calls GetTimeZoneInformation. This function returns the 'bias', where: UTC = local time + bias [2].

The bias needs to be inverted before being sent to the new UniversalTimeToLocal/LocalTimeToUniversal functions.

Please consider the attached patch.


Thank you.



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

dateutil.inc.patch (1004 bytes) Download Attachment