• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 554
  • Last Modified:

Start Week Date

How find the startdate of the week in given month and given year.
0
asterUser
Asked:
asterUser
1 Solution
 
imitchieCommented:
What language are you after? VB.net?
0
 
bungHocCommented:
Use DateTime.DayOfWeek

Hope it helps..
int year = 2007, month = 12;
int daysInMonth = System.DateTime.DaysInMonth(year, month);
 
for (int i = 0; i< daysInMonth; i++)
{
  DateTime date = DateTime.Parse(year, month, i)
  if (date.DayOfWeek == DayOfWeek.Monday)
  {
     // Start Date of the week.
  }
}

Open in new window

0
 
Computer101Commented:
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Tackle projects and never again get stuck behind a technical roadblock.
Join Now