Here you can find the source of getFileName()
public static String getFileName()
//package com.java2s; import java.sql.Timestamp; import java.text.SimpleDateFormat; public class Main { public static String getFileName() { SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd_HH-mm-ss_SS"); String fileName = format.format(new Timestamp(System .currentTimeMillis()));//from w ww .jav a 2 s . c om return fileName; } }