Ver Mensaje Individual
  #8  
Antiguo 22-10-2017
MacStreet MacStreet is offline
Miembro
 
Registrado: oct 2017
Posts: 16
Reputación: 0
MacStreet Va por buen camino
Cita:
Empezado por ecfisa Ver Mensaje
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 // manejar el problema...
    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 :/
Responder Con Cita