Connecting Tech Pros Worldwide Forums | Help | Site Map

Adding no. of Days to the Current Date.

Newbie
 
Join Date: Jun 2007
Location: bangalore (India)
Posts: 13
#1: Aug 8 '07
Hi All,

I am having prblm in adding the no. of days passed to the current date, in a class fuction.
This is an immediate requirment plz help..

I am using java.util.Date object for the current date..

Thanks in advance:)

JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#2: Aug 8 '07

re: Adding no. of Days to the Current Date.


Quote:

Originally Posted by nagarwal

Hi All,

I am having prblm in adding the no. of days passed to the current date, in a class fuction.
This is an immediate requirment plz help..

I am using java.util.Date object for the current date..

Thanks in advance:)

Have a look at the Calendar class.

kind regards,

Jos
Newbie
 
Join Date: Jun 2007
Location: bangalore (India)
Posts: 13
#3: Aug 9 '07

re: Adding no. of Days to the Current Date.


Quote:

Originally Posted by JosAH

Have a look at the Calendar class.

kind regards,

Jos

Hi Jos,

Calendar is not a fully quantified class to instantiate..so how does it help??
plz be a bit clear..any clues/ links to refer??

Thanks & regrds.
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#4: Aug 9 '07

re: Adding no. of Days to the Current Date.


Quote:

Originally Posted by nagarwal

Hi Jos,

Calendar is not a fully quantified class to instantiate..so how does it help??
plz be a bit clear..any clues/ links to refer??

Thanks & regrds.

The javadocs gives you all that you need. If you open the page for Calendar, you'll see a link to the GregorianCalendar ...
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#5: Aug 9 '07

re: Adding no. of Days to the Current Date.


Quote:

Originally Posted by nagarwal

Hi Jos,

Calendar is not a fully quantified class to instantiate..so how does it help??
plz be a bit clear..any clues/ links to refer??

Thanks & regrds.

Did you actuall *read* the API documentation? Even on the first page it tells
you about the getInstance() method that gives you a Calendar you can
work with. Just seeing 'abstract class' is no reason to stop reading.

kind regards,

Jos
Reply