function DiasEntreFechas (d1, d2 : TDateTime) : Integer; begin result := DateTimeToTimeStamp(d2).Date - DateTimeToTimeStamp(d1).Date; end;