Android Long to Date Convert formatTime(long timeInMillis)

Here you can find the source of formatTime(long timeInMillis)

Description

format Time

Declaration

public static String formatTime(long timeInMillis) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static final String TIME_FORMAT = "HH:mm";

    public static String formatTime(long timeInMillis) {
        return format(TIME_FORMAT, timeInMillis);
    }/*from   w w  w  .j  a v  a 2s .com*/

    private static String format(String pattern, long timeInMillis) {
        final SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        return sdf.format(new Date(timeInMillis));
    }
}

Related

  1. getActivityTime(long startTime, long endTime)
  2. getDate(long timeStamp)
  3. getDateFrom(long timestamp, Context context)
  4. getDateFromLong(long dateLong)
  5. getDateTimeString(long time_milis)
  6. formatDate(long timeInMillis)
  7. getCurrentDate(long time)
  8. changeMillisToFormat(long milliseconds, String pattern)
  9. convertLongToDateString(long mills, String format)