Here you can find the source of getCurrentCompactTime()
public static String getCurrentCompactTime()
//package com.java2s; import java.text.*; import java.util.*; public class Main { private static String CurrentTime; public static String getCurrentCompactTime() { Date NowDate = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); CurrentTime = formatter.format(NowDate); return CurrentTime; }//ww w .j a v a 2s .co m }