Avatar of Stef Merlijn
Stef Merlijn
Flag for Netherlands

asked on 

Get start- and enddate of a certain week


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.
function GetStartEndDateOfWeek(Weeknr, Yearnr : Integer; FirstDay : Boolean) : TDateTime;
  // If FirstDay = True then 
  //   Result := Date of Monday of that week
  // else
  //   Result := Date of Sunday of that week

Open in new window


Avatar of undefined
Last Comment
Stef Merlijn

8/22/2022 - Mon