Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting system date

 
akhter wahab
Ranch Hand
Posts: 151
Java MyEclipse IDE Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys i wrote a program that can get the system date but problem is i want to add 7 days in the current date how could it be possible not getting please help
here is the code
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check if the Calendar class had any methods that might help ?
 
Fredrik Sassenberg
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The calender class can be a bit tricky to work with. But it does have a method add which I think will solve your problem.



So I added the line to your program:

 
Rob Spoor
Sheriff
Pie
Posts: 20546
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fredrik, there is a reason Joanne didn't mention that method. Please don't provide full answers if a hint will be enough.
 
Fredrik Sassenberg
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After reading up a bit on the link you provided I see your point Rob.
My good intention wasn't well thought through. Thank you for the information.

 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
two method are there .
First is add and second is roll.but you can use only one i .e add
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic