Android Long to Date Convert getTimeString(long millis)

Here you can find the source of getTimeString(long millis)

Description

get Time String

License

Apache License

Declaration

public static String getTimeString(long millis) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String getTimeString(long millis) {
        StringBuffer buffer = new StringBuffer();

        int minutes = (int) ((millis % (1000 * 60 * 60)) / (1000 * 60));
        int seconds = (int) (((millis % (1000 * 60 * 60)) % (1000 * 60)) / 1000);

        buffer.append(String.format("%02d", minutes)).append(":")
                .append(String.format("%02d", seconds));

        return buffer.toString();
    }//from   w  w w .j a va  2  s .  c  om
}

Related

  1. toJulianDay(long epochMillis)
  2. toJulianDayNumber(long epochMillis)
  3. toString(Long datetime)
  4. toTimeString(long milliseconds)
  5. stringForTime(long timeMs)
  6. parseTime(long time, String pattern)
  7. getDateByInt(long va)
  8. getDateTimeString(long dateTime)
  9. getLabelForEventInTime(long inTime)