给你代码
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, ComCtrls;type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Button1: TButton;
    Edit1: TEdit;
    Button2: TButton;
    Label1: TLabel;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;
  iAllSeconds:integer;
  iday:integer;
  iremain:integer;
  ihour,iminute,isecond,itemp:integer;
  lastday:boolean;
implementation{$R *.DFM}procedure TForm1.Timer1Timer(Sender: TObject);
var
    dtTemp:TDateTime;
begin
    dtTemp:=strtodatetime('2001-10-27 17:01:00')-now;
    iAllSeconds:=Round(dtTemp*24*60*60);
    if iallseconds>0 then
    begin
      iday:=round(int(dttemp));
      iremain:=iallseconds mod (3600*24);
      if (iday=0) and lastday then begin
        ihour:=24;
        lastday:=false;
      end
      else
        ihour:=iremain div 3600;
      itemp:=iremain mod 3600;
      iminute:=itemp div 60;
      itemp:=itemp mod 60;
      isecond:=itemp;
      label1.caption:='还有'+inttostr(iday)+'天'+inttostr(ihour)+'小时'+inttostr(iminute)+'分'+inttostr(isecond)+'秒';
    end
    else
    label1.caption:='Happy Birthday';end;procedure TForm1.FormCreate(Sender: TObject);
begin
lastday:=true;
timer1.OnTimer(sender);
end;end.