Android examples for java.util:Calendar Format
get Time Display from Calendar
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Locale; public class Main { public static String getTimeDisplay(Calendar cal) { SimpleDateFormat dateFormat = new SimpleDateFormat("hh:mm aa", Locale.getDefault()); return dateFormat.format(cal.getTime()); }//from www . j a v a 2 s . com }