Android Long to Date Convert getFormatDateString(String format, long date)

Here you can find the source of getFormatDateString(String format, long date)

Description

get Format Date String

Declaration

public static final String getFormatDateString(String format, long date) 

Method Source Code

//package com.java2s;

public class Main {

    public static final String getFormatDateString(String format) {
        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(
                format);/*  ww w  .  ja v a2  s.  c  om*/
        java.util.Date d = new java.util.Date();
        return sdf.format(d);
    }

    public static final String getFormatDateString(String format,
            java.util.Date date) {
        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(
                format);
        return sdf.format(date);
    }

    public static final String getFormatDateString(String format, long date) {
        java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(
                format);
        return sdf.format(new java.util.Date(date));
    }
}

Related

  1. convertLongToDateString(long mills, String format)
  2. format(String pattern, long timeInMillis)
  3. formatDateD(Context paramContext, long paramLong)
  4. formatTimeStampString(Context context, long when, boolean fullFormat)
  5. getDatesStartingFromToWithInterval( long startDate, long endDate, int dayInterval)
  6. getLongFriendlyDate(long timeInMillis)
  7. getShortFriendlyDate(long timeInMillis)
  8. getTimeStringFrom(long timestamp)
  9. humanFriendlyDate(long time)