Android examples for java.util:Date Format
Format time in long to String
import android.content.Context; import android.content.res.AssetManager; import android.os.Environment; import android.text.format.DateFormat; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URLDecoder; import java.net.URLEncoder; import java.util.ArrayList; public class Main{ public static String timeString(long dateTaken) { return DateFormat.format("yyyy/MM/dd kk:mm:ss", dateTaken) .toString();//from w w w .ja v a 2 s. co m } }