Re: IdSysVCL.OffsetFromUTC always returns 0

Giganews Newsgroups
Subject: Re: IdSysVCL.OffsetFromUTC always returns 0
Posted by:  Philip von Melle (philip.vonmel…
Date: Mon, 10 Oct 2005

OK, this wasn't very clever since it calls Win32 code that should be in
IdSysWin32 (and in fact already is). The fix here would be to include IdSys
in the implementation uses clause of IdSysVCL (to avoid circular
references) and then in the class function DateTimeToGmtOffSetStr() call
Sys.OffsetFrom UTC to call the Win32 or .NET version in IdSysWin32 or
IdSysVCLNET according to the conditional compiles in IdSyS so that
IdSysVCL.OffsetFromUTC is never called directly.

Regards, Philip

Philip von Melle <philip.vonmel…> wrote:

> 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;



In response to

IdSysVCL.OffsetFromUTC always returns 0 posted by Philip von Melle on Thu, 6 Oct 2005