How to convert x (elapsed) milliseconds into human-readable format "..d..h..m..s" ?

Discussion in 'Java' started by Ulf Meinhardt, Sep 13, 2009.

  1. Assume I have a number of milliseconds.

    How can I convert this value into a more human-readable format
    with days, hours, minutes and seconds like:

    56d17h23m56s

    If the number of days is equals to 0 then the "d" part should be omitted.

    Ulf
    Ulf Meinhardt, Sep 13, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    7
    Views:
    82
  2. Chris Angelico
    Replies:
    2
    Views:
    62
    Chris Angelico
    Feb 19, 2014
  3. Mark Lawrence
    Replies:
    0
    Views:
    43
    Mark Lawrence
    Feb 19, 2014
  4. Chris Angelico
    Replies:
    0
    Views:
    38
    Chris Angelico
    Feb 19, 2014
  5. Dan Goodman
    Replies:
    0
    Views:
    57
    Dan Goodman
    Feb 19, 2014
Loading...

Share This Page