uses System.DateUtils;
[pascal]
// 取得某一天所在的星期一及星期天
procedure TForm1.Button1Click(Sender: TObject);
var dw1,dw7,dnow:tdatetime;
begin
dnow:=StrtoDatetime(edtnow.Text);
dw1:=(StartOfTheWeek(dnow));
edtw1.Text := Datetimetostr(dw1);
dw7:=(Endoftheweek(dnow));
edtw7.Text := Datetimetostr(dw7);
end;
[/pascal]