how to get the date of Friday for the given week

HI,I have a requirement to get the date of Friday for the given week.Eg: I have an input of 200722 (Yearweek), From this I need to get the Date of the friday for this week 22 of Year 2007.Plz let me know how to get this..Thanks in advance..Sridhar.
[290 byte] By [Java_mska] at [2007-11-27 4:18:58]
# 1
Calendar cal = Calendar.getInstance();cal.set(Calendar.WEEK_OF_YEAR, woy);cal.set(Calendar.YEAR, year);cal.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);System.out.println ("Date: " + cal.get(cal.DATE));
kdajania at 2007-7-12 9:25:51 > top of Java-index,Java Essentials,New To Java...
# 2

Hi,

Thanks for your reply...

I have implemented your logic but not getting exact output as required.

Suppose, If i give the input as 200720, I am getting an output as 18 (friday of week 20 of year 2007), but i need to get an output of 18.05.2007

Plz let me know how to do thdi.

Thanks in advance..

Java_mska at 2007-7-12 9:25:51 > top of Java-index,Java Essentials,New To Java...
# 3
[url= http://java.sun.com/docs/books/tutorial/i18n/format/simpleDateFormat.html]The Java?Tutorial - Customizing Formats[/url]~
yawmarka at 2007-7-12 9:25:51 > top of Java-index,Java Essentials,New To Java...
# 4
Check out the Calendar API
kdajania at 2007-7-12 9:25:51 > top of Java-index,Java Essentials,New To Java...
# 5
Hi, I tried to use the date formats with SimpleDateFormat function, but i am getting the errors. Could plz let me know how to use in this situation. Thanks in advance......
Java_mska at 2007-7-12 9:25:51 > top of Java-index,Java Essentials,New To Java...
# 6
> Hi, > > I tried to use the date formats with SimpleDateFormat> function, How?> but i am getting the errors. Which ones?
PhHeina at 2007-7-12 9:25:51 > top of Java-index,Java Essentials,New To Java...
# 7
Hi,Plz see below the code which I have written.Date friday;String result;SimpleDateFormat formatter;formatter = new SimpleDateFormat("dd MM yy");friday = cal.get(cal.DATE); result = formatter.format(friday);Plz correct me,if i am
Java_mska at 2007-7-12 9:25:51 > top of Java-index,Java Essentials,New To Java...
# 8
Try this:Date friday;String result;SimpleDateFormat formatter;formatter = new SimpleDateFormat("dd.MM.yyyy");friday = cal.getTime();result = formatter.format(friday);
PhHeina at 2007-7-12 9:25:51 > top of Java-index,Java Essentials,New To Java...
# 9
Hi Hein,My problem is solved....Thanks........
Java_mska at 2007-7-12 9:25:51 > top of Java-index,Java Essentials,New To Java...