Ver Mensaje Individual
  #2  
Antiguo 25-10-2014
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 21
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
jeremiselxi,

Cita:
Empezado por jeremiselxi
...Restar dos fechas en Delphi 2009...


Revisa este código:
Código Delphi [-]
...
uses DateUtils;
...
var
  fromdate, toDate : TDateTime;

begin
  // Set up our date variables
  fromDate := EncodeDateTime(2000, 02, 26, 10, 0, 0, 0);
  toDate   := EncodeDateTime(2000, 02, 29,  9, 0, 0, 0);

  // Display these dates and the days between them
  ShowMessage('From date = '+DateTimeToStr(fromDate));
  ShowMessage('To   date = '+DateTimeToStr(toDate));
  ShowMessage('Whole days difference = '+
              IntToStr(DaysBetween(toDate, fromDate))+' days');
end;
...
Tomado de DaysBetween

Revisa esta información:
Espero sea útil

Nelson.
Responder Con Cita