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