date difference

2001-12-13 Thread King Maurice

Does someone have an example of how to calculate the date difference in java.

For example I have these two dates
date #1 [12/01/2001]
date #2 [12/31/2002]

How do I calculate the # of days apart from date #1 to date #2

Need some guidiance~

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: date difference

2001-12-13 Thread Chris Pratt

This series of articles in JavaWorld helped me with a similar question
http://www.javaworld.com/jw-12-2000/jw-1229-dates.html
(*Chris*)

- Original Message -
From: King Maurice [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 13, 2001 2:44 PM
Subject: [JSP-INTEREST] date difference


 Does someone have an example of how to calculate the date difference in
java.

 For example I have these two dates
 date #1 [12/01/2001]
 date #2 [12/31/2002]

 How do I calculate the # of days apart from date #1 to date #2

 Need some guidiance~


===
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: date difference

2001-12-13 Thread Richard Yee

You can first parse the strings using the DateFormat.parse() method to get
a Date object and then use the Date.getTime() method to return the # of
milliseconds from the epoch for each date.
Subtract the values returned by getTime().
Divide the result by (60 * 60 * 24 * 1000)  = (8640) to get the # of
days difference.

Regards,

Richard


At 03:44 PM 12/13/2001 -0700, you wrote:
Does someone have an example of how to calculate the date difference in java.

For example I have these two dates
date #1 [12/01/2001]
date #2 [12/31/2002]

How do I calculate the # of days apart from date #1 to date #2

Need some guidiance~

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: date difference

2001-12-13 Thread Chris Pratt

Actually, this is probably the most useful:
http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-time.html
(*Chris*)

- Original Message -
From: Chris Pratt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 13, 2001 3:06 PM
Subject: Re: [JSP-INTEREST] date difference


 This series of articles in JavaWorld helped me with a similar question
 http://www.javaworld.com/jw-12-2000/jw-1229-dates.html
 (*Chris*)

 - Original Message -
 From: King Maurice [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, December 13, 2001 2:44 PM
 Subject: [JSP-INTEREST] date difference


  Does someone have an example of how to calculate the date difference in
 java.
 
  For example I have these two dates
  date #1 [12/01/2001]
  date #2 [12/31/2002]
 
  How do I calculate the # of days apart from date #1 to date #2
 
  Need some guidiance~
 
 

===
  To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
 JSP-INTEREST.
  For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
 DIGEST.
  Some relevant FAQs on JSP/Servlets can be found at:
 
   http://archives.java.sun.com/jsp-interest.html
   http://java.sun.com/products/jsp/faq.html
   http://www.esperanto.org.nz/jsp/jspfaq.jsp
   http://www.jguru.com/faq/index.jsp
   http://www.jspinsider.com


 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com



===
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: date difference

2001-12-13 Thread syed huda

Is there any way to get the difference in year, month, day format?

- Original Message -
From: Richard Yee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 13, 2001 4:18 PM
Subject: Re: date difference


 You can first parse the strings using the DateFormat.parse() method to get
 a Date object and then use the Date.getTime() method to return the # of
 milliseconds from the epoch for each date.
 Subtract the values returned by getTime().
 Divide the result by (60 * 60 * 24 * 1000)  = (8640) to get the # of
 days difference.

 Regards,

 Richard


 At 03:44 PM 12/13/2001 -0700, you wrote:
 Does someone have an example of how to calculate the date difference in
java.
 
 For example I have these two dates
 date #1 [12/01/2001]
 date #2 [12/31/2002]
 
 How do I calculate the # of days apart from date #1 to date #2
 
 Need some guidiance~
 

===
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
 JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:
 
   http://archives.java.sun.com/jsp-interest.html
   http://java.sun.com/products/jsp/faq.html
   http://www.esperanto.org.nz/jsp/jspfaq.jsp
   http://www.jguru.com/faq/index.jsp
   http://www.jspinsider.com


===
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com


===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: date difference

2001-12-13 Thread Richard Yee

I would think that the results of such a calculation would not be very
accurate since months and years have varying lengths.

For instance, what would be the result of taking the difference of
11/30/2001 and 2/28/2001 ?
is it 9 months or 9 months and two days?

Regards,

Richard

At 04:28 PM 12/13/2001 -0700, you wrote:
Is there any way to get the difference in year, month, day format?

- Original Message -
From: Richard Yee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 13, 2001 4:18 PM
Subject: Re: date difference


  You can first parse the strings using the DateFormat.parse() method to get
  a Date object and then use the Date.getTime() method to return the # of
  milliseconds from the epoch for each date.
  Subtract the values returned by getTime().
  Divide the result by (60 * 60 * 24 * 1000)  = (8640) to get the # of
  days difference.
 
  Regards,
 
  Richard
 
 
  At 03:44 PM 12/13/2001 -0700, you wrote:
  Does someone have an example of how to calculate the date difference in
java.
  
  For example I have these two dates
  date #1 [12/01/2001]
  date #2 [12/31/2002]
  
  How do I calculate the # of days apart from date #1 to date #2
  
  Need some guidiance~
  
 
 ===
  To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
  JSP-INTEREST.
  For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
  Some relevant FAQs on JSP/Servlets can be found at:
  
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com
 
 
===
  To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
  For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
  Some relevant FAQs on JSP/Servlets can be found at:
 
   http://archives.java.sun.com/jsp-interest.html
   http://java.sun.com/products/jsp/faq.html
   http://www.esperanto.org.nz/jsp/jspfaq.jsp
   http://www.jguru.com/faq/index.jsp
   http://www.jspinsider.com
 

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: date difference

2001-12-13 Thread Chris Tucker

Take a look at the javadocs on java.util.Date and java.util.Calendar.
Chances are you'll also want to work with java.util.GregorianCalendar (the
Gregorian calendar being the one the western world lives on).

-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of syed huda
Sent: Thursday, December 13, 2001 3:29 PM
To: [EMAIL PROTECTED]
Subject: Re: date difference


Is there any way to get the difference in year, month, day format?

- Original Message -
From: Richard Yee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 13, 2001 4:18 PM
Subject: Re: date difference


 You can first parse the strings using the DateFormat.parse() method to get
 a Date object and then use the Date.getTime() method to return the # of
 milliseconds from the epoch for each date.
 Subtract the values returned by getTime().
 Divide the result by (60 * 60 * 24 * 1000)  = (8640) to get the # of
 days difference.

 Regards,

 Richard


 At 03:44 PM 12/13/2001 -0700, you wrote:
 Does someone have an example of how to calculate the date difference in
java.
 
 For example I have these two dates
 date #1 [12/01/2001]
 date #2 [12/31/2002]
 
 How do I calculate the # of days apart from date #1 to date #2
 
 Need some guidiance~
 

===
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
 JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:
 
   http://archives.java.sun.com/jsp-interest.html
   http://java.sun.com/products/jsp/faq.html
   http://www.esperanto.org.nz/jsp/jspfaq.jsp
   http://www.jguru.com/faq/index.jsp
   http://www.jspinsider.com


===
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com


===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



determining date difference

2000-11-16 Thread Heidi Krout

Can anyone tell me how to calculate the (days, months, years) difference
between two dates?




Visit our website at http://www.p21.com/visit
The information in this e-mail is confidential and may contain legally
privileged information.  It is intended solely for the person or entity to
which it is addressed.  Access to this e-mail by anyone else is
unauthorized. If you are not the intended recipient, any disclosure,
copying, distribution, action taken, or action omitted to be taken in
reliance on it, is prohibited and may be unlawful.  If you received this
e-mail in error, please contact the sender and delete the material from any
computer.

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets