This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Java in General and the fly likes getting the start date for a week number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "getting the start date for a week number" Watch "getting the start date for a week number" New topic
Author

getting the start date for a week number

Dar Var
Ranch Hand

Joined: Oct 12, 2004
Posts: 74
Hi,
I am trying to get the start date for a week when given the week number an year.

My calender setting will be

Calendar gregorianCalendar = new GregorianCalendar();
gregorianCalendar.setFirstDayOfWeek(Calendar.MONDAY);
gregorianCalendar.setMinimalDaysInFirstWeek(4);

for example:
if my method is passed in 40/2005 i.e. week 40 in year 2005
The method should pass back 03/10/2005 i.e. 3rd Oct 2005
Ritesh Agrawal
Ranch Hand

Joined: Jan 08, 2004
Posts: 74
Hi Dar,

I have added a couple of lines to your code. Lets see if this is what you were looking for.



Cheers!!!

[ October 03, 2005: Message edited by: Ritesh Agrawal ]

Ritesh<br /> <br />SCJP 1.4<br />IBM Test 340<br />IBM AIX V4.0 Certified Professional<br /> <br />Right actions for the future are the best apologies for wrong ones in the past.<br />- Tyron Edwards
 
 
subject: getting the start date for a week number