Here you can find the source of getCurrentTime()
@SuppressLint("SimpleDateFormat") public static String getCurrentTime()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import android.annotation.SuppressLint; public class Main { @SuppressLint("SimpleDateFormat") public static String getCurrentTime() { Date date = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); String text = sdf.format(date); return text; }//from w w w . j ava 2 s. c o m }