--> Calculating century - n by a certain date. | Delphi Tips Trick

For Newbie

Wednesday, 16 November 2011

Calculating century - n by a certain date.

| Wednesday, 16 November 2011
Function declaration:
centurycalculate function (const d: TDate): Word;
var
   tg, bl, th: Word;
begin
   DturecodeDate (D, th, bl, tg);
   Result: = th p 100;
end;

Example of implementation:
procedure TForm1.Button1Click (Sender: TObject);
var
   d: TDate;
begin
   d: = DateTimePicker1.Date;
   with Memo1.Lines do
   begin
     Clear;
     Add ('Date' + DateToStr (d) + 'located in the century -' +
         IntToStr (HitungAbad (d)));
   end;
end;

Related Posts

No comments: