Android examples for java.util:Calendar Format
Create Calendar from long value and format as dd/MM/yyyy hh:mm:ss a
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getDate(long milliSeconds) { SimpleDateFormat formatter = new SimpleDateFormat( "dd/MM/yyyy hh:mm:ss a"); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(milliSeconds); return formatter.format(calendar.getTime()); }// www .j a va2 s . c o m }