Android Long to Date Convert formatDate(long timeInMillis)

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

Description

format Date

Declaration

public static String formatDate(long timeInMillis) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static final String DATE_FORMAT = "yyyy-MM-dd";

    public static String formatDate(long timeInMillis) {
        return format(DATE_FORMAT, timeInMillis);
    }/*ww  w  . jav  a  2s  . c  om*/

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

Related

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