This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to Calculate 30 days minus Today's Date? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to Calculate 30 days minus Today Watch "How to Calculate 30 days minus Today New topic
Author

How to Calculate 30 days minus Today's Date?

James Dekker
Ranch Hand

Joined: Dec 09, 2006
Posts: 215
Am trying to figure out how to create a mechanism which will:

1. Compute today's date.

2. Minus it by 30 days (based on a String const that is placed in an inner class)?

Here's my constant:



Here's my calling code:



Am confused as my requirement is to use a constant parameter which is String?

Thank you for taking the time to read this...
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Am confused as my requirement is to use a constant parameter which is String?

You will need to construct(hint) an Integer(hint) from the string constant, so you can use it in the add method


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Divya Janyavula
Greenhorn

Joined: May 24, 2011
Posts: 19
[mg]edited out solution
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Divya,
Welcome to the Ranch. I had to edit out your post because
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.

Divya Janyavula
Greenhorn

Joined: May 24, 2011
Posts: 19
Was not aware. Thanks for that
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Calculate 30 days minus Today's Date?
 
Similar Threads
How to manipulate date / time using Calendar and then put the modified data inside the Date class?
Grouse about Calendar, DateFormat, Date
problem: How to get last month date
Date and Calender help
Date - finding tomorrow