15,662,823 members
See more:
hi.
i have year,month and week number of month and week day.
for example:
1994,jun,week number in month:4, monday.
how can i get date?
Posted

## Solution 1

The solution is country dependent !
In Europe week start on Monday, in USA week start on Sunday.

This is not a programming problem, it is a mathematical problem.

You have to find the algorithm for your country because the week don't start the same day in every country. I suggest to use Wikipedia.
https://en.wikipedia.org/wiki/ISO_week_date[^]
https://en.wikipedia.org/wiki/Week[^]

Conventions in your date data may also play in the solution:
- how are you numbering the first week of a month when it is only 1 or 2 days ?

v3
PIEBALDconsult 29-Aug-15 18:58pm
"in USA week start on Sunday"

No. There are International Standards that specify Monday. These apply to the U.S.
Patrice T 29-Aug-15 19:19pm
Wikipedia disagree with you :)
https://en.wikipedia.org/wiki/Week

## Solution 2

It is mostly maths, try this example to find the date for the Wednesday on 4th week of February 2016. Test it with other dates and parameter, say 5th week, it will cross over to March.
```using System;

public class Program
{
public static void Main()
{
DateTime dt = new DateTime(2016, 2, 1); // create the start date of the month and year
DayOfWeek firstDayOfWeekofMonth = dt.DayOfWeek; // Find out the day of week for that date
int myWeekNumInMonth = 4; // You want the 4th week, this may cross over to the following month!
string myDayOfWeek = "Wednesday";  // You want Wednesday
int myDayOfWeekInt = day2Int(myDayOfWeek);
int diff = myDayOfWeekInt - (int)firstDayOfWeekofMonth;
}

public static int day2Int(string dayOfWeek)
{
switch (dayOfWeek)
{
case "Sunday":
return 0;
case "Monday":
return 1;
case "Tuesday":
return 2;
case "Wednesday":
return 3;
// Finish the rest yourself
default:
return -1; // Do error checking
}
}
}```

Find out more:
1. DayOfWeek Enumeration[^]

v2
rahman_jalayer 30-Aug-15 10:52am
thanks a lot mr. Peter Leow.
it works great.
thank you.
Peter Leow 31-Aug-15 5:23am
You are welcome.