How to find Start and End date for a specified date in ASP.Net

Just use these functions...

 

DateTime lFnGetBeginningOfWeek(DateTime date)

{

 

return date.AddDays(-1 * (int)date.DayOfWeek).Date;

 

}

 

 

DateTime lFnGetEndOfWeek(DateTime aDate)

{

return aDate.AddDays(6 - (int)aDate.DayOfWeek);

}

Ebook Download
View all
Learn
View all