How to get the current week starting date and add it to a combo box?

前端 未结 4 1565
不知归路
不知归路 2021-02-14 10:17

I\'m attempting to recreate a time sheet built on asp and I can\'t figure out how to get the current weeks starting date \"6-13-2010\" and have it populate a combo box can you h

4条回答
  •  死守一世寂寞
    2021-02-14 10:48

    DateTime startOfWeek = Today.AddDays((int)Today.DayOfWeek * -1)
    

    Likely an off by one error, since it is untested.

提交回复
热议问题