Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FpGetTimeOfDay gives no timezone
#3
Thanks rlebeau.

What I did now (and it works!) is the following:

Removed lines 7356 and 7357 from IdGlobal.
// timeval: TTimeVal;
// timezone: TTimeZone;
Added a new line:
NowDT:tDateTime;

Removed original lines 7412, 7413 (after the insert of the above 7413, 7414):
// fpGetTimeOfDay (@TimeVal, @TimeZone);
// Result := -1 * (timezone.tz_minuteswest / 60 / 24);
And added two new lines (using DateUtils that is included in this set-up already):
NowDT:=Now;
result:=NowDT-LocalTimeToUniversal(NowDT);

Recompiled indylaz. Works perfekt.

It would be nice to have it fixed in the official IdGlobal as well somehow.

One more point, I have not inverstigated deeper:
DateUtils uses GetLocalTimeOffset to get the LocalTimeToUniversal conversion, so theoretically it would be enough to have:
result:=-GetLocalTimeOffset/60;
Still if I do that in IdGlobal, it gives 0, not the real Offset. Either IdGlobal accesses another version of GetLocalTimeOffset from another library or TZSeconds is not yet initialised if called directly.
Reply


Messages In This Thread
FpGetTimeOfDay gives no timezone - by jollytall - 01-04-2019, 03:59 PM
RE: FpGetTimeOfDay gives no timezone - by rlebeau - 01-06-2019, 08:00 PM
RE: FpGetTimeOfDay gives no timezone - by jollytall - 01-13-2019, 01:16 PM
RE: FpGetTimeOfDay gives no timezone - by rlebeau - 01-14-2019, 09:15 PM
RE: FpGetTimeOfDay gives no timezone - by rlebeau - 01-15-2019, 06:22 PM
RE: FpGetTimeOfDay gives no timezone - by rlebeau - 01-19-2019, 01:18 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)