omnibrain 15 Posted October 30, 2023 (edited) I am using Delphi 11.2 (Patch 1) on Windows 11 (22H2): A few weeks ago, I added a check to our software to be able to verify against a time server independently of the rest of the system, as our customers had issues with internal network time synchronization in the past. Since Sunday, we "suddenly" have a one-hour deviation. Last weekend we went back from UTC+2 to UTC+1. I have simplified it to the most basic test possible, just a form with a TIdSNTP component and an edit box to enter the server. And even then, I still get a time that is exactly one hour in the future. Have I overlooked something? Since we are now on "standard time," I would have expected there to have been problems during development and testing in the past weeks. IdSNTP1.Host:=LabeledEdit1.Text; memo1.Lines.Add('Server: '+LabeledEdit1.Text+' Internet time: '+DateTimeToStr(IdSNTP1.DateTime)+' Local time: '+datetimetostr(now)); The result is: Quote Server: ptbtime1.ptb.de Internet time: 30.10.2023 11:54:00 Local time: 30.10.2023 10:54:00 Server: time.nist.gov Internet time: 30.10.2023 11:54:08 Local time: 30.10.2023 10:54:20 Edited October 30, 2023 by omnibrain Share this post Link to post
Fr0sT.Brutal 900 Posted October 30, 2023 SNTP just receives UTC time. Conversion to local time must be done with system functions using system's database of daylight zones. Probably you have obsolete DB Share this post Link to post
omnibrain 15 Posted October 30, 2023 9 minutes ago, Fr0sT.Brutal said: SNTP just receives UTC time. Conversion to local time must be done with system functions using system's database of daylight zones. Probably you have obsolete DB Of course, but in the code of the component there is "NTPToDateTime" and in there "UTCTimeToLocalTime". And like I said. Last week it worked. I would have expected an error of 2 hours last week, if this was the case. Share this post Link to post
Fr0sT.Brutal 900 Posted October 30, 2023 Probably you don't have fixed revision? #386 fix from @BoIitos for a day offset bug in TIdSNTP.NTPToDateTime(). https://github.com/IndySockets/Indy/blob/master/Lib/Protocols/IdSNTP.pas Share this post Link to post
omnibrain 15 Posted October 30, 2023 Ah, I see. Thank you. I did not know, that Indy is on github. Let's hope the fixed version comes with Delphi 12. Share this post Link to post
Remy Lebeau 1396 Posted October 30, 2023 3 hours ago, omnibrain said: I did not know, that Indy is on github. Yes, and has been for several years now: https://www.indyproject.org/2019/11/28/indy-svn-retiring-long-live-github/ 3 hours ago, omnibrain said: Let's hope the fixed version comes with Delphi 12. Yes, it will include an updated snapshot of Indy from about a month ago. However, you don't have to upgrade Delphi just to get a new Indy version. You can install the latest GitHub repo version manually: https://github.com/IndySockets/Indy/wiki/Updating-Indy 1 Share this post Link to post