File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 10268
    
    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: 10268
    
    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?