Wednesday, January 5, 2011

Hitung Selisih Tanggal

Cara menghitung beda hari pada tanggal.
Deklarasi fungsi:
function SelisihTanggal(TglOld,TglNew: TDate): Integer;
begin
  Result:= Trunc(TglNew - TglOld);
end;
Contoh implementasi:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Edit1.Text:= IntToStr(SelisihTanggal(DateTimePicker1.Date, DateTimePicker2.Date));
end;

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Kang Iwan K-sev | Thank's for your visit To My Site - Ridwan Mulyana | Cibeureum