Java tutorial
//package com.java2s; import android.annotation.SuppressLint; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { @SuppressLint("SimpleDateFormat") public static String getPhoneCurrentTime() { SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); return date.format(Calendar.getInstance().getTime()); } }