aspose file tools*
The moose likes Beginning Java and the fly likes Subtracting Dates in JAVA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Subtracting Dates in JAVA" Watch "Subtracting Dates in JAVA" New topic
Author

Subtracting Dates in JAVA

Sam Drake
Ranch Hand

Joined: Jun 05, 2003
Posts: 33
Hi,
Can anybody give me a code snippet to subtract dates in JAVA? The idea is to get the number of days between any 2 dates.
Thnx,
Sam.
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Sam,
How about getting the difference in milliseconds:
d1.getTime() - d2.getTime();
Regards,
Manfred.
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Check out this thread.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Subtracting Dates in JAVA
 
Similar Threads
Reformating date
Date calculation
Passing Date from HTML Form to JSP/Action Handler
caculating the difference between dates
amount of days ????