Tips Trik Delphi - Hitung Selisih Tanggal | opxbit.web.id

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;


Output:

Output - Hitung Selisih Tanggal

Output - Selisih Tanggal


Source Code Delphi - Hitung Selisih TanggalDownload
Source Code Delphi - Hitung Selisih Tanggal
File: selisih_tanggal.zip
Hits: 354


VN:F [1.9.6_1107]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)
Hitung Selisih Tanggal, 5.0 out of 5 based on 1 rating




2 Responses to Hitung Selisih Tanggal

  1. aresitaliano says:

    terimh kasih……..

  2. opx says:

    sama-sama gan.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>