IdSysVCL.OffsetFromUTC always returns 0

Giganews Newsgroups
Subject: IdSysVCL.OffsetFromUTC always returns 0
Posted by:  Philip von Melle (philip.vonmel…@globetrotter.de)
Date: Thu, 6 Oct 2005

During the .NET conversion at some point the routine OffsetFromUTC has
changed so that it returns 0 now ( one single line Result := 0). All the
previous has gone. It seems to work under .NET, though.

My suggestion here would be:

class function TIdSysVCL.OffsetFromUTC: TIdDateTimeBase;
var
  tzinfo : TTimeZoneInformation;
Begin
  getTimeZoneInformation( tzInfo );
  Result := -1 * (tzInfo.Bias + tzInfo.DayLightBias ) / MinsPerDay ;
end;

Philip

Replies