This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding three weeks to a date

 
Lisa Modglin
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to compute several dates based on another date. I understand how to use the GregorianCalendar to add weeks to another GregorianCalendar object, but I have a date. Is it really necessary to get each portion of my date in order to instantiate the GregorianCalendar object? I don't see where the constructor takes a date. Any suggestions?
 
Horatio Westock
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


 
Lisa Modglin
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much! I'm still fairly new and I overlook things. So, you intantiate the object to today's date, then set the time to your date object. Works for me!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic