Android examples for android.text.format:DateFormat
format Locale Date using android DateFormat
//package com.java2s; import android.content.Context; import android.text.format.DateFormat; import java.util.Date; import java.util.TimeZone; public class Main { /**/*from w ww .java 2s . c o m*/ @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)); } }