Get the first day of the week

Madhuk
Posted by Madhuk under C# category on | Points: 40 | Views : 2542
The following code gives the first day of a week.

 DateTime date = DateTime.Now;
int count = Convert.ToInt16(date.DayOfWeek);
date.AddDays(-count);
// Gives the day of the week
Response.Write(date.DayOfWeek);

Comments or Responses

Login to post response