datetimecalc TacDateTimeCalc
Hierarchy Properties
Return to Introduction  Previous page  Next page
Overview
The acDateTimeCalc component calculates number of years, months, days, hours, munutes, seconds and milliseconds between two dates specified by BeginTime and EndTime properties.  

How to use?
Just specify the BeginTime and EndTime properties and read number of years, months, days, hours, minutes, seconds and milliseconds from the according public properties.  

Example
procedure TForm1.DateTimePicker1Change(Sender: TObject);  
begin  
  DTCalc.BeginTime := DateTimePicker1.Date + DateTimePicker2.Time;  
  DTCalc.EndTime := DateTimePicker3.Date + DateTimePicker4.Time;  
 
  LYears.Caption := 'Years:' + IntToStr(DTCalc.Years);  
  LMonths.Caption := 'Months:' + IntToStr(DTCalc.Months);  
  LDays.Caption := 'Days:' + IntToStr(DTCalc.Days);  
  LHours.Caption := 'Hours:' + IntToStr(DTCalc.Hours);  
  LMinutes.Caption := 'Minutes:' + IntToStr(DTCalc.Minutes);  
  LSeconds.Caption := 'Seconds:' + IntToStr(DTCalc.Seconds);  
  LMSeconds.Caption := 'MSeconds:' + IntToStr(DTCalc.MSeconds);  
end;