Hi Team,
D10.4.1, Indy as comes with D10.4, 32 bit App. Tested on Win 10 & Win 2012 R2 server.
I have the following code in my App in the form create procedure with IdSNTP in the uses..
var
SNTPClient: TIdSNTP;
begin
//
SNTPClient := TIdSNTP.Create(nil);
try
//
SNTPClient.Host := 'time.windows.com';
//
ShowMessage(DateTimeToStr(SNTPClient.DateTime));
//
if SNTPClient.SyncTime then
ShowMessage('Time sync worked.')
else
ShowMessage('Time Sync didnt work.');
//
finally
SNTPClient.Free;
end;
//
When run, the initial showmessage shows the correct date/time but I get the "didn't work" message after the .SyncTime.
I manually changed my PC clock out of sync and ran the routine again, it didn't adjust the clock.
I seem to recall many moons ago that this did work, possibly with D10.3, I don't exactly recall. My original code was created in Nov'19.
What have I missed please???
Regards & TIA,
Ian