Android Long to Date Convert changeMillisToFormat(long milliseconds, String pattern)

Here you can find the source of changeMillisToFormat(long milliseconds, String pattern)

Description

change Millis To Format

License

Apache License

Declaration

public static String changeMillisToFormat(long milliseconds,
            String pattern) 

Method Source Code

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

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static String changeMillisToFormat(long milliseconds,
            String pattern) {//from   w  ww. j a v a2  s .c  om
        Date fecha = new Date(milliseconds);
        return changeDateToFormatString(fecha, pattern);
    }

    public static String changeDateToFormatString(Date fecha, String pattern) {
        DateFormat formato = new SimpleDateFormat(pattern);
        return formato.format(fecha);
    }
}

Related

  1. getDateFromLong(long dateLong)
  2. getDateTimeString(long time_milis)
  3. formatTime(long timeInMillis)
  4. formatDate(long timeInMillis)
  5. getCurrentDate(long time)
  6. convertLongToDateString(long mills, String format)
  7. format(String pattern, long timeInMillis)
  8. formatDateD(Context paramContext, long paramLong)
  9. formatTimeStampString(Context context, long when, boolean fullFormat)