This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes getting system date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "getting system date" Watch "getting system date" New topic
Author

getting system date

akhter wahab
Ranch Hand

Joined: Mar 02, 2009
Posts: 151

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


Start Earning Online||Start Earning Using Java
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3432
    
  12
Did you check if the Calendar class had any methods that might help ?


Joanne
Fredrik Sassenberg
Greenhorn

Joined: Jul 08, 2009
Posts: 4
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

Joined: Oct 27, 2005
Posts: 19655
    
  18

Fredrik, there is a reason Joanne didn't mention that method. Please don't provide full answers if a hint will be enough.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Fredrik Sassenberg
Greenhorn

Joined: Jul 08, 2009
Posts: 4
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

Joined: Mar 17, 2010
Posts: 1051

two method are there .
First is add and second is roll.but you can use only one i .e add


SCJP6.0,My blog Ranchers from Delhi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting system date
 
Similar Threads
adding to java.sql.Date
java.security.AccessControlException: access denied (java.awt.AWTPermission createRobot) Exception
SimpleDateFormat problem....
JavaScript date help
weird java dates!!!!