I want to write a function that gets a week number in a year, and returns the start date of that week. Also another function that gets the week number, and returns the end date of that week.
Pseudocode:
public DateTime GetSaturdayDateOfWeek(int weekNumberInYear)
{
// calculations, that finds the Saturday of that week, 00:00:00 of midnight
return DateTime.Now;
}
public DateTime GetFriddayDateOfWeek(int weekNumberInYear)
{
// calculations, that finds the Friday of that week, 23:59:59
return DateTime.Now;
}
How can I calculate these dates?
This question is in PHP and doesn't help me. Also this question gets the week number of the month. I have the week number in the year.