Android Long to Date Convert getHoursAndMinutes(long dateTimeMillis)

Here you can find the source of getHoursAndMinutes(long dateTimeMillis)

Description

get Hours And Minutes

Declaration

public static String getHoursAndMinutes(long dateTimeMillis) 

Method Source Code

//package com.java2s;

public class Main {
    public static String getHoursAndMinutes(long dateTimeMillis) {
        String format = String.format("%%0%dd", 2);
        long elapsedTime = dateTimeMillis / 1000;
        String minutes = String.format(format, (elapsedTime % 3600) / 60);
        String hours = String.format(format, elapsedTime / 3600);
        return hours + ":" + minutes;
    }/* w  w  w. j  a v  a  2  s  . c o m*/
}

Related

  1. getElapsedDurationSince(long seconds)
  2. getFormattedTime(String dateTimeFormat, long timestamp)
  3. getFriendlyDate(Context context, long timestamp)
  4. getHour(long dateTimeMillis)
  5. getHour(long timeMillis)
  6. getLocalTimeFromUTCMillis(long utcMillis)
  7. getLongOfString(String date)
  8. getMinute(long dateTimeMillis)
  9. getMinutesSinceStartOfDay(long milliseconds)