Android examples for java.io:File Name
create File Name from current time in yyyy-MM-dd-HH-mm-ss format
import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final String DEFAULT_FILE_PATTERN = "yyyy-MM-dd-HH-mm-ss"; public static String createFileName() { Date date = new Date(System.currentTimeMillis()); SimpleDateFormat format = new SimpleDateFormat(DEFAULT_FILE_PATTERN); return format.format(date); }// w w w . j a va 2 s . co m }