arunreddy
8/6/2012 - 6:47 PM

Seconds to HH MM SS

Seconds to HH MM SS

    private String formatIntoHHMMSS(long secondsInput)
    {
        int hours = (int) (secondsInput / 3600), remainder = (int) (secondsInput % 3600), minutes = remainder / 60, seconds =
            remainder % 60;

        return ((hours < 10 ? "0" : "") + hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":"
            + (seconds < 10 ? "0" : "") + seconds);
    }