Android examples for java.util:Date Format
get Current Time in yyyy-MM-ddHHmmssS format
import android.annotation.SuppressLint; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ /**// www. j a v a 2 s .co m * yyyy-MM-ddHHmmssS * @return */ public static String getCurTime() { Date date = new Date(System.currentTimeMillis()); SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-ddHHmmssS"); final String path = dateFormat.format(date); return path; } }