Java Millisecond Convert millisToString(long millis)

Here you can find the source of millisToString(long millis)

Description

millis To String

License

Open Source License

Declaration

public static String millisToString(long millis) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String millisToString(long millis) {
        int length = (int) Math.floor(millis / 1000D);
        int hours = (int) Math.floor(length / 60D / 60D);
        length -= hours * 60 * 60;/*from   w w w.j av a  2s.  co  m*/
        int minutes = (int) Math.floor(length / 60D);
        length -= minutes * 60;
        return (hours > 0 ? hours + ":" : "") + (minutes < 10 & hours > 0 ? "0" : "") + minutes + ":"
                + (length < 10 ? "0" + length : length);
    }
}

Related

  1. millisToSeconds(long millis)
  2. millisToSeconds(long millis)
  3. millisToSeconds(long millis)
  4. millisToShortDHMS(long duration)
  5. millisToString(float millis)
  6. millisToString(long ms)
  7. millisToString(long t)
  8. millisToStringDouble(double millis)
  9. millisToText(long millis)