unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
function time1(A:Tdatetime;B:Tdatetime):integer;
begin
result:=strtoint(FloatTostr(A-B));
end;
function newtime(A:Tdatetime;B:integer):TDateTime;
begin
result:=(A+(B/24*3600));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption:=FloatToStr(time1(time,time-1*24*3600));
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
label1.caption:=datetimetostr(newtime(time,1000));
end;
end.