Avatar of Stef Merlijn
Stef Merlijn
Flag for Netherlands

asked on 

Get start- and enddate of a certain week

Hi,

I have a weeknumber and a year.
Based on those two values I need to determine the first and last date of that week (monday and sunday).

Week: 30
Year: 2008
Should return: 21-07-2008 or 27-07-2008 (format: DD-MM-YYYY)

I prefer to have a function where I can input weeknr, yearnr and a boolean value for first day or last day.
Thanks,
Stef
function GetStartEndDateOfWeek(Weeknr, Yearnr : Integer; FirstDay : Boolean) : TDateTime;
begin
  // If FirstDay = True then 
  //   Result := Date of Monday of that week
  // else
  //   Result := Date of Sunday of that week
end;

Open in new window

Delphi

Avatar of undefined
Last Comment
Stef Merlijn

8/22/2022 - Mon