unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
stopLbl: TLabel;
addLbl: TLabel;
HasilLbl: TLabel;
Timer1: TTimer;
Timer2: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
add,stop,decrease :TDateTime;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Stop := Now;
stopLbl.Caption := formatdatetime('hh:nn:ss',Stop);
add := Now + ((1/24/60)*10);
addLbl.Caption := FormatDateTime('hh:nn:ss',add);
timer1.Enabled:=false;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
Decrease := add-now;
HasilLbl.Caption := formatdatetime('hh:nn:ss',Decrease);
end;
end.
And the Result will be like the picture below (HasilLbl will be decreased)