This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JDBC and the fly likes Comparing Timestamp values? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Comparing Timestamp values?" Watch "Comparing Timestamp values?" New topic
Author

Comparing Timestamp values?

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 953
How do you compare two Timestamp values to see if one is 'x' minutes older than another, for example?
If you have one Timestamp, say t1 and another, t2, how can you see if the difference in time between them is, say 5 minutes?
Basically, I need to be able to somehow take the difference between to Timestamps to see how much time has elapsed.
From looking at the API, there doesn't seem to be a simple way to do this.
Any help or advice would be appreciated.
Thanks!
-- Mike
Krishna Mohan
Ranch Hand

Joined: May 30, 2003
Posts: 44
See this Link.
Scroll all the way to bottom to see some code.
Hope that helps
Krishna


Programming is Fun.
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 953
Hi Krishna,
Yes, this link was very helpful.
THANK YOU!!!
-- Mike
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Comparing Timestamp values?
 
Similar Threads
Handling java.sql.Timestamp
Time Stamp values
Confused about SQL Timestamp
In-memory hashmap refresh in servlet
Timestamp in GMT and the difference