GeeCON Prague 2014*
The moose likes Java in General and the fly likes Differnce between time. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Differnce between time." Watch "Differnce between time." New topic
Author

Differnce between time.

Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 159
I want to find the differnce between two time which is in 12 hrs format.



But instead of getting 9 hrs differnce, i'm getting only 3 hrs differnce.

Where i'm going wrong?
Raymond Tong
Ranch Hand

Joined: Aug 15, 2010
Posts: 230
    
    2

http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html
Check on the letter for Hour.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Just for the sake of providing docs that aren't really old:

http://download-llnw.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

And please post actual code--those dates aren't even parseable by your own code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Differnce between time.