Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 550
  • 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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