Here you can find the source of getDateFrom(long timestamp, Context context)
public static String getDateFrom(long timestamp, Context context)
//package com.java2s; import java.util.Date; import android.content.Context; import android.text.format.DateFormat; public class Main { public static String getDateFrom(long timestamp, Context context) { if (timestamp <= 0) return ""; return DateFormat.getDateFormat(context).format( getDateFromLong(timestamp)); }//from w w w .ja v a2s .c om public static Date getDateFromLong(long dateLong) { if (dateLong == 0) { return null; } return new Date(dateLong); } }