number of date

J

Jay

Hi,

I have Calendar object for "begindate" and "enddate".
is there easy way to get number of days in between?

Thanks.

-Jay
 
T

Tony Dahlman

Jay said:
Hi,

I have Calendar object for "begindate" and "enddate".
is there easy way to get number of days in between?

Thanks.

-Jay

Although I have never needed to use it, Roedy Green does supply a
BigDate class that, no doubt, does this very well once you load
the entire class.

If you just want to subtract two dates, you might want to try
this:

http://pws.prserv.net/ad/programs/Programs.html#DateDiff

Good luck and hope this helps. Regards, Tony Dahlman
 
T

Tony Morris

Tony Dahlman said:
Although I have never needed to use it, Roedy Green does supply a
BigDate class that, no doubt, does this very well once you load
the entire class.

If you just want to subtract two dates, you might want to try
this:

http://pws.prserv.net/ad/programs/Programs.html#DateDiff

Good luck and hope this helps. Regards, Tony Dahlman


(cal1.getTimeInMillis() - cal2.getTimeInMillis()) / (1000 * 60 * 60 * 24)

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
 
T

Tony Dahlman

(cal1.getTimeInMillis() - cal2.getTimeInMillis()) / (1000 * 60 * 60 * 24)

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)

That's good Tony (glib too :), and no doubt right.

So how do you do this for months and years?

Regards, Tony Dahlman
 
T

Tony Morris

So how do you do this for months and years?
Regards, Tony Dahlman

Not so easily, but I did it in C++ many years ago for a university project.

--
Tony Morris
(BInfTech, Cert 3 I.T.)
Software Engineer
IBM Australia - Tivoli Security Software
(2003 VTR1000F)
Sun Certified Programmer for the Java 2 Platform (1.4)
Sun Certified Developer for the Java 2 Platform
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top