This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

increment date by 6 days

 
nabou diack
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi I would like to know how to increment a date received from an access database by 6 more days. thanks
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need the java.util.GregorianCalendar and java.text.SimpleDataFormat classes. After formatting your date you can use the gregorianCalendat class to increment the days.


------------------
Bosun
SCJP for the Java� 2 Platform
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you need a SimpleDateFormat?

I find this the easiest method, but I still think the whole Date/Calendar/DateFormat thing is way too hard to use.
Jamie
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct Jamie. SimpleDateFormat is not needed.


------------------
Bosun
SCJP for the Java� 2 Platform
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic