Android examples for java.util:Date
get Date from long value
//package com.java2s; import android.annotation.SuppressLint; import java.text.SimpleDateFormat; import java.util.Date; public class Main { @SuppressLint("SimpleDateFormat") public static String getDate(long timeMillis) { return new SimpleDateFormat("yyyy/MM/dd").format(new Date( timeMillis));//w ww .j a va 2s. c o m } public static String getDate(long timeMillis, String strFormat) { return new SimpleDateFormat(strFormat).format(new Date(timeMillis)); } }