Android Long to Date Convert parseMills2Time(long elapsedMills)

Here you can find the source of parseMills2Time(long elapsedMills)

Description

parse Mills Time

Declaration

public static String parseMills2Time(long elapsedMills) 

Method Source Code

//package com.java2s;

public class Main {
    public static String parseMills2Time(long elapsedMills) {
        return parseInt2Time(Integer.parseInt(elapsedMills + ""));
    }//  www.  ja  va 2  s  . c o  m

    public static String parseInt2Time(int millisecond) {
        int hour = (int) ((long) millisecond / (60 * 60 * 1000));
        int munit = (int) ((long) (millisecond % (60 * 60 * 1000)) / (60 * 1000));
        int second = (int) ((long) (millisecond % (60 * 1000)) / 1000);
        return (hour == 0 ? "" : hour > 10 ? hour + ":" : "0" + hour + ":")
                + (munit == 0 ? "00:" : munit < 10 ? "0" + munit + ":"
                        : munit + ":")
                + (second == 0 ? "00" : second < 10 ? "0" + second : second);
    }
}

Related

  1. longToCalendar(Long time)
  2. longToSqlDateFormat(long date)
  3. millisToLongDHMS(long duration)
  4. millisToShortDHMS(long duration)
  5. nextDate(long timeMilliSeconds)
  6. shortFromUtc(long milliseconds)
  7. timeInMillisToText(final long totalTimeInMillis)
  8. timeInMillisecondsToDateStringFull( long timeInMilliseconds)
  9. timestampToDate(long timeStamp)