Android Long to Date Convert formatElapsedTime(long totalTimeSeconds)

Here you can find the source of formatElapsedTime(long totalTimeSeconds)

Description

format Elapsed Time

Declaration

public static String formatElapsedTime(long totalTimeSeconds) 

Method Source Code

//package com.java2s;

public class Main {
    public static String formatElapsedTime(long totalTimeSeconds) {
        int seconds = (int) (totalTimeSeconds) % 60;
        int minutes = (int) ((totalTimeSeconds / (60)) % 60);
        int hours = (int) ((totalTimeSeconds / (60 * 60)) % 24);
        return String.format("%dh,  %dm, %ds", hours, minutes, seconds);
    }//from   w  ww .j a  v a 2  s .c om
}

Related

  1. transMillionToTime(long milliseconds)
  2. transformDateTime(long t)
  3. millis2cal(long milliseconds, boolean clearTime)
  4. millisToString(long l)
  5. stdDateFormat(long t)
  6. formatSecondsToHHMM(long seconds)
  7. getStringByFormat(long milliseconds, String format)
  8. getStringByFormat(long milliseconds, String format)
  9. convertToTime(long time)