Advertisement

09.01.2005 at 09:33AM PDT, ID: 21547942
[x]
Attachment Details

How to find difference in day between two Dates in Java?

Asked by modle in Java Programming Language

Tags: java, difference, between, dates

How to get the day diff between currday and dateposted? Thanks.
java.util.Date currdate = new java.util.Date();  //today
java.util.Date dateposted = rs1.getDate("DatePosted");

Also what If I use
Calendar cal2 = Calendar.getInstance();  to get today's date.  How to get the day diff between today and dateposted?Start Free Trial
 
Loading Advertisement...
 
[+][-]09.01.2005 at 10:49AM PDT, ID: 14804344

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.01.2005 at 02:35PM PDT, ID: 14806131

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Tags: java, difference, between, dates
Sign Up Now!
Solution Provided By: objects
Participating Experts: 5
Solution Grade: A
 
 
[+][-]09.01.2005 at 10:37PM PDT, ID: 14807841

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.01.2005 at 11:57PM PDT, ID: 14808110

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2005 at 11:46PM PDT, ID: 14821926

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.28.2005 at 01:57PM PST, ID: 15566242

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]12.29.2005 at 09:13AM PST, ID: 15571777

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.02.2006 at 05:25AM PST, ID: 15590948

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32