Android examples for java.util:Date Compare
get Current Date Time in yyyyMMddHHmmss format
import android.content.Context; import android.telephony.TelephonyManager; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ public static String getCurrentlyDateTime() { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); return dateFormat.format(new Date()); }/*from www.jav a2 s . c o m*/ }