Android Long to Date Convert stringForTime(long timeMs)

Here you can find the source of stringForTime(long timeMs)

Description

string For Time

Declaration

public static String stringForTime(long timeMs) 

Method Source Code

//package com.java2s;

public class Main {
    public static String stringForTime(long timeMs) {
        long totalSeconds = timeMs / 1000;

        long seconds = totalSeconds % 60;
        long minutes = (totalSeconds / 60) % 60;
        long hours = totalSeconds / 3600;
        return String.format("%02d:%02d:%02d", hours, minutes, seconds);
    }//from w ww .ja va  2s .c o m
}

Related

  1. toIso8601(long date, boolean utc)
  2. toJulianDay(long epochMillis)
  3. toJulianDayNumber(long epochMillis)
  4. toString(Long datetime)
  5. toTimeString(long milliseconds)
  6. getTimeString(long millis)
  7. parseTime(long time, String pattern)
  8. getDateByInt(long va)
  9. getDateTimeString(long dateTime)