Android examples for java.util:Date Time
get Time in yyyyMMddHHmmss format
import android.annotation.SuppressLint; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ public static String getTimeName() { Date date = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); return dateFormat.format(date); }// w ww.j a v a2s. c o m }