Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String createFileName(String fileType) { String fileName = ""; Date date = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss"); fileName = sdf.format(date) + fileType; return fileName; } }