Recent

Author Topic: Indy sent mail timestamp is incorrect  (Read 1877 times)

jollytall

  • Full Member
  • ***
  • Posts: 128
Indy sent mail timestamp is incorrect
« on: September 05, 2021, 02:08:58 pm »
We had recently a thread (https://forum.lazarus.freepascal.org/index.php/topic,55969.0.html) where I did not use the latest Indy version and so I could not get the right time zone offset.
Now I use  the latest Indy and the difference between local time and UTC is correct but somehow the direction is the opposite. I am at UTC + 2 hours but my sent mail shows UTC - 2 hours and so on the receiving end the difference between correct time and mail timestamp is 4 hours. I could not figure out where the error is. There are three steps and maybe it is an interpretation problem: What should the offset be, positive or negative?
GetLocalTimeOffset is in FPC returning the offset in minutes
OffsetFromUTC is in IdGlobal converts it to tDateTime (double)
UTCOffsetToStr is also in IdGlobal converts it to string.
It would be very easy to change any of the three, but I am not sure which is the right place to do it, or maybe there is some other issue.

(In my other thread the original, still unsolved issue was that the Now function was incorrect in Linux on one of two identically installed PCs. Well this issue is on the "OK" one, so this problem is not related to that.)

jollytall

  • Full Member
  • ***
  • Posts: 128
Re: Indy sent mail timestamp is incorrect
« Reply #1 on: September 07, 2021, 05:29:16 pm »
I am not sure I did the right thing, but for the time being I have just changed the signs in IdGlobal lines 7952 and 7954 and not it works. Would be glad if someone could test if it was again some magic in my setup only, or it is a bug somewhere (maybe not where I fixed it).

 

TinyPortal © 2005-2018