This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Java in General and the fly likes Adding weeks to a date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Adding weeks to a date" Watch "Adding weeks to a date" New topic
Author

Adding weeks to a date

Sahil Sharma
Ranch Hand

Joined: Aug 27, 2003
Posts: 152
Hi All,

I have system date with me and i want to add weeks to it. 1, 2, 3 or 4 weeks, depends on user selection. but options available are only 4. 1-4 weeks.
Also if i want to know what day today is(saturday,sunday) then how to know this ?

Thanks
Vinod Awar
Ranch Hand

Joined: Nov 06, 2006
Posts: 129
Hi

we can know the day like this



and you can also add weeks by using add() method refer java.util.GregorianCalendar API
 
 
subject: Adding weeks to a date