get Image Name via Timestamp - Android Graphics

Android examples for Graphics:Image File

Description

get Image Name via Timestamp

Demo Code


//package com.java2s;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String getImageName() {
        Date date = new Date(System.currentTimeMillis());
        SimpleDateFormat dateFormat = new SimpleDateFormat(
                "'IMG'_yyyy-MM-dd HH:mm:ss");
        return dateFormat.format(date) + ".png";
    }//from ww w  .j a v  a 2  s . c  o  m
}

Related Tutorials