If you use Time and Date, use the Indy IdSNTP component and set: host: time.windows.com
and in the Timer1Timer event (TTimer component) write:
Label1.Caption := DateToStr(IdSNTP1.DateTime) + ' - ' + TimeToStr(IdSNTP1.DateTime); Label2.Caption := IdSNTP1.Host;
you see by the form (labe1, label2) Date now AND Time now. Therefore, if you set Time synchronized, put IdSNTP1.SyncTime; in the Timer1Timer event.
source share