Here you can find the source of getCurrentTimeForName()
public static String getCurrentTimeForName()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.*; public class Main { /**/*from ww w . j av a2 s .com*/ * Gets current date (for random name of new item) * * @return current date in yyMMdd_HHmmss format */ public static String getCurrentTimeForName() { SimpleDateFormat f = new SimpleDateFormat("yyMMddHHmmss_"); return f.format(Calendar.getInstance().getTime()); } }