How many weeks have passed?

 




Procedure TForm1.Button1Click ( Sender : TObject ) ;

Var

   firstDay , toDay : TDateTime ;

   week        : Integer ;

Begin

   firstDay := StrToDate ( '28.08.1997' ) ;

   toDay := now ;

   week := Trunc ( ( toDay - firstDay ) / 7 ) + 1 ;

   Caption := IntToStr ( week ) ;

End ;


Back Home Foward