Q&A

  • 날짜 제한..
90일 이후 메세지나 제한 띄우기..
=========================================
uses    DateUtils;

procedure TForm1.formcreate(Sender: TObject);
var
fromdate, toDate : TDateTime;
begin

  //시작일
  fromDate := EncodeDateTime(2010, 11, 5, 0, 0, 0, 0);
  //지금날짜
  toDate   := now();

   //60일 지나면
  if  round( DaySpan(toDate, fromDate)) > 60 then
  begin
    showmessage('60일이나 지났습니다. ');
  
   //종료하려면
   application.terminate;
  end;

//ShowMessage('From date = '+DateTimeToStr(fromDate));
//ShowMessage('To   date = '+DateTimeToStr(toDate));
//showmessage(  FloatToStr( round( DaySpan(toDate, fromDate)) ) );

end;



1  COMMENTS