wood burning stoves 2.0*
The moose likes Java in General and the fly likes Compare Hours and Minute in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Compare Hours and Minute in java" Watch "Compare Hours and Minute in java" New topic
Author

Compare Hours and Minute in java

pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
Hi List,
How can i compare the time in java as my time format is Hours:Minute.
example: i am getting time like this : 1645 and 1500 so how can i compare this time.

Please tell me.

Thanks
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What do you mean by compare? Are you looking for which is earlier/later? If so, the Calendar class has before and after methods. Or do you mean find out how much the time difference is? In which case, these two times are just ultimately a long representing a number of milliseconds. You could subtract one from the other.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compare Hours and Minute in java
 
Similar Threads
compare two xml files thru .java class using SAX / DOM parser
object comparison
Comparing XML to XSLT
how to get LastModified time of a file in repository(in weblogic8.2 )
Code Craft vs. Effective Java