I have problem in finding the date using day of the week.
For example : i have past date lets say,
Date date= Convert.TodateTime("01/08/2013");
08th Jan 2013 th Day of the week is Tuesday.
Now i want current week's tuesday's date. How i can do it.
Note : The past date is dynamic. It will change in every loop.
You can use the enumeration DayOfWeek
We can use the conversion to integer to calculate the difference from the current date of the same week day
This also seems appropriate to create an extension method
and now you could call it with
You can use this....
I may be a bit late to the party, but my solution is very similar:
This will get the Tuesday of the current week, where finding Tuesday is the primary goal (I may have misunderstood the question).