This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Thanks for your reply, My problem is that I have to compare two dates and determine if they are of the same week. here is no method which take parameter date and return week of the year.
Joined: Nov 08, 2001
Than build one. Get the day of the week for the first day. [S,M,T,W,T,F,S] subtract the number of days to get the start of the week. See if the other date is greater than the start date. If it is, add seven days and see if it is less than or equal to this new date. If it is, you know it is in the range of the week.
Other option is you take your two days and make them both go to the first day of the week. See if they are the same day. [probably a simpler solution!]