Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import android.annotation.SuppressLint; public class Main { @SuppressLint("SimpleDateFormat") public static String nowTimeString() { String str = null; SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmsss"); str = sdf.format(new Date()); return str; } }