How can I calculate a time span in Java and format the output?

Posted by fiXedd on Stack Overflow See other posts from Stack Overflow or by fiXedd
Published on 2009-03-11T19:11:09Z Indexed on 2010/05/08 23:18 UTC
Read the original article Hit count: 227

Filed under:
|
|
|
|

I want to take two times (in seconds since epoch) and show the difference between the two in formats like:

  • 2 minutes
  • 1 hour, 15 minutes
  • 3 hours, 9 minutes
  • 1 minute ago
  • 1 hour, 2 minutes ago

How can I accomplish this??

© Stack Overflow or respective owner

Related posts about java

Related posts about date