Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing 2 Date Objects

Status
Not open for further replies.

SON1

Programmer
Nov 21, 2004
51
CY
I have two date objects, which i would like to compare and find out how much time/hours/minutes they have difference between.

Can anyone provide any help ?

Thanx
 
however, none does what i asked for :)
 
The compareTo() method perhaps ?

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
... followed by two calls to getTime() - depending on which date is after which, subtract each long from the other, and then there you have it - the difference in time in milliseconds. Then all you have to do is some very simple maths to work out the minutes/hours/days etc - use your common sense !!!

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
that makes more sense, thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top