Here you can find the source of getCompactTime()
public static String getCompactTime()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCompactTime() { Date curDate = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); String result = sdf.format(curDate); return result; }/*from w w w . j av a2 s . co m*/ }