Here you can find the source of getCurrentDateTime()
public static String getCurrentDateTime()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCurrentDateTime() { Date d = new Date(); SimpleDateFormat df = new SimpleDateFormat(); df.applyPattern("yyyy/MM/dd HH:mm:ss"); return df.format(d); }/*ww w . j a v a 2s . c o m*/ public static String getCurrentDateTime(boolean WithDelimeter) { if (WithDelimeter) return new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date()); return new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); } }