Java Long Number to Time calcTime(final long totalTime)

Here you can find the source of calcTime(final long totalTime)

Description

Calculate time from milliseconds

License

Open Source License

Parameter

Parameter Description
totalTime Time in milliseconds

Return

Time in the format mm:ss.ss

Declaration

public static String calcTime(final long totalTime) 

Method Source Code

//package com.java2s;

import java.text.DecimalFormat;

public class Main {
    private final static DecimalFormat timeFormat = new DecimalFormat("00.00");

    /**//from   www . java  2  s  .c  om
     * Calculate time from milliseconds
     *
     * @param totalTime Time in milliseconds
     * @return Time in the format mm:ss.ss
     */
    public static String calcTime(final long totalTime) {
        return totalTime / 60000 + ":" + timeFormat.format((totalTime % 60000) / 1000);
    }
}

Related

  1. addMinTime(long time, String addMin)
  2. convertLong2String(Long time, String format)
  3. convertLongDate(long lDate, String format)
  4. convertLongTimeStampToString(long localTimeStamp)
  5. convertLongTimeToText(Long time)