Java tutorial
//package com.java2s; import android.annotation.SuppressLint; import java.text.SimpleDateFormat; import java.util.Date; public class Main { @SuppressLint("SimpleDateFormat") public static String getNowTime() { Date date = new Date(System.currentTimeMillis()); SimpleDateFormat dateFormat = new SimpleDateFormat("MMddHHmmssSS"); return dateFormat.format(date); } }