Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Differnce between time.

 
Neeba Rebbaca
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 255
2
IntelliJ IDE Java Spring
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please post actual code--those dates aren't even parseable by your own code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic