Java tutorial
//package com.java2s; import android.os.Environment; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getDatePhotoName() { String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath(); Date date = new Date(System.currentTimeMillis()); SimpleDateFormat dateFormat = new SimpleDateFormat("'IMG'_yyyyMMdd_HHmmss"); return dateFormat.format(date) + ".JPG"; } }