Java tutorial
//package com.java2s; import android.content.Context; import android.text.format.DateFormat; import java.util.Date; import java.util.TimeZone; public class Main { /** @param time input in milliseconds TODO: covert to seconds */ public static String formatLocaleDate(Context context, long time) { java.text.DateFormat df = DateFormat.getMediumDateFormat(context); df.setTimeZone(TimeZone.getTimeZone("GMT")); return df.format(new Date(time)); } }