Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Random; public class Main { public static String getRandomFileName() { String rel = ""; SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); Date curDate = new Date(System.currentTimeMillis()); rel = formatter.format(curDate); rel = rel + new Random().nextInt(1000); return rel; } }