I have the day of week (eg monday),week of year (eg 41) and year (eg 2007)
From this I want to calculate the date in the form dd/MM/yyyy but i am not sure how to do this.
Searches on google and such have not provided me with a solution to my problem.
What I attempted to do was take the week of year and find the date of the monday of that week and work from there. However i could not get this to work and was wondering if there was another way.
Check out java.util.Calendar, java.util.Date and java.text.(Simple)DateFormat.
- create a Calendar instance
- set the values of that Calendar instance
- retrieve a Date from that Calendar instance
- create a DateFormat
- format the Date
Use a Calendar to get a representation of the specific date you need (setting the year, week in year, and day of week fields). Then when you have it configured get a Date object from the Calendar and use DateFormat to output a String in the format you want.