Click here to Skip to main content
15,914,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get a list of days for particualar week if I give Month, Year & weekNo as input.
eg. GetRangeofdate (int month, int year, int weekno)
C#
List<DateTime> myDates=    GetRangeofdate(1,2012,2)


The result should be.

08-Jan-2012
09-Jan-2012
10-Jan-2012
11-Jan-2012
12-Jan-2012
13-Jan-2012
14-Jan-2012
Thanks in advance
Posted
Comments
Andreas Gieriet 22-Jan-12 13:22pm    
Be aware that there are multiple systems out in the field.
See http://en.m.wikipedia.org/wiki/Seven-day_week#Week_numbering.
E.g. US differs from Europe...
Cheers
Andi

1 solution

Use the DateTime[^] structure, it has properties and methods that will provide what you need.

[edit]My tip[^] on getting the first week of the year may also help.[/edit]
 
Share this answer
 
v2
Comments
Espen Harlinn 22-Jan-12 7:21am    
My 5 :)
Richard MacCutchan 22-Jan-12 7:26am    
Thanks, I see you have nothing better to do today, same as me.
Espen Harlinn 22-Jan-12 7:50am    
Actually I've got a fair amount of work ahead of me - I'm just waiting for a bit of inspiration...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900