Get date of first and last day of week knowing week number

后端 未结 8 1990
渐次进展
渐次进展 2020-12-16 20:24

I need to get the date of the first and last day of the week knowing the week number.

I get a start date and an end date, representing the first and last day of a s

8条回答
  •  抹茶落季
    2020-12-16 21:00

    Subtract 1 year from your original DateTime and call your GetWeekNumber method again with that.

    TimeSpan oneYear = dateTime.AddYears(1) - dateTime;
    var lastYearWeekNumber = GetWeekNumber(dateTime.Subtract(oneYear));
    

提交回复
热议问题