Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi friends


How can i find the date for given year,month,week number.dayofweek

example:
year:2013
month:12
week number:3
dayofweek: saturday
Posted
Updated 21-Jun-13 5:08am
v4
Comments
José Amílcar Casimiro 20-Jun-13 11:24am    
what you intend to achieve? the date is already present.
siva575 21-Jun-13 11:13am    
suppose i have date like 2013-06-21 so year is 2013 month is 06 week number is 4 day of week is Friday

then i have to find after 4 th friday after 3 months

There is no single answer to this: AFAIK there is no standard for week-of-month which is universally accepted - in fact the definition can vary even within a single country, unlike week-of-year which is covered by ISO8601. If you look here[^] you will see what complications WOY introduces, and you should realize that these also apply to WOM.

You will have to look at the year and month and work out what week day 1 is in first, then work forward to find out which range of dates ar in the required on. Be careful though - if your rules are anything like WOY, some of your days may be in last month, or next month because weeks don't start on the first of the month.

This may help: http://stackoverflow.com/questions/2136487/calculate-week-of-month-in-net[^]
 
Share this answer
 

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