File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Subtract two timeperiods

 
sandy kailash
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends,

I want to subtract two timeperiods say 04:46:30 from 02:30:22 and also the reverse should give the true result...

i want the result in milliseconds or in hh:mm:ss

Is there any java function for this.

and also function to convert the value from millseconds to hh:mm:ss.

thanks in advance..
 
Carey Brown
Ranch Hand
Pie
Posts: 1074
11
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's code that converts a begin ms and end ms into a duration string:

 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That actually looks an awkward way to do it. There is a far better way, but that would only give a clean result with a positive difference.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic