Here you can find the source of getCurDateTIme()
public static String getCurDateTIme()
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getCurDateTIme() { return new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); }/*from w w w . j a v a 2 s .c o m*/ public static String format(Calendar calendar) { return new SimpleDateFormat("dd-MM-yyyy").format(calendar.getTime()); } }