This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 151
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.
 
Similar Threads
find time differnce between to calender
Difference Between two dates
Time format in Java
Need to find diff between two dates : - 60 days
10000 milliseconds showing as 01:00:10.000 - why ?