Android examples for java.util:Date Convert
transform long value to Date Time
import android.content.Context; import android.telephony.TelephonyManager; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ public static String transformDateTime(long t) { Date date = new Date(t); SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); return dateFormat.format(date); }// w ww . ja v a 2s . co m }