Cita:
Empezado por ecfisa
Hola.
Código Delphi [-]
...
implementation
uses IdSNTP;
function iNetDateTime(const aHost: string) : TDateTime;
var
idSNTP: TIdSNTP;
begin
idSNTP:= TIdSNTP.Create(nil);
try
idSNTP.Host := aHost;
Result := idSNTP.DateTime;
finally
idSNTP.Free;
end;
end;
...
Ejemplo de uso:
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var
dt: TDateTime;
begin
try
dt := iNetDateTime('time.windows.com');
ShowMessage( DateToStr(dt) );
except ShowMessage('Error obteniendo la fecha');
end;
end;
En el siguiente enlace tenes una lista con servidores horarios:
Saludos
|
No me funciona
osea si obtiene la fecha y todo, pero lo que yo quiero hacer es que mi aplicacion al detectar el dia "10/09/2017" se cierre .
espero que me entiendas :/