Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding weeks to a date

 
Sahil Sharma
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

we can know the day like this



and you can also add weeks by using add() method refer java.util.GregorianCalendar API
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic