The moose likes Java in General and the fly likes Differnce between time. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Differnce between time." Watch "Differnce between time." New topic
Author

Differnce between time.

Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 116
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: 156

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Differnce between time.
 
Similar Threads
10000 milliseconds showing as 01:00:10.000 - why ?
find time differnce between to calender
Need to find diff between two dates : - 60 days
Difference Between two dates
Time format in Java