Android examples for java.util:Date Format
Get current Time in yyyy/MM/dd HH:mm format using SimpleDateFormat
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main{ public static String currentTime() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm"); return sdf.format(new Date()); }// w w w . j a v a2s . c o m }