Here you can find the source of getCurrentTime()
public static String getCurrentTime()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCurrentTime() { return getCurrentTime("yyyyMMddHHmmss"); }/*from w w w . ja va 2 s . c om*/ public static String getCurrentTime(String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(new Date()); } }