Here you can find the source of getCurrentDateStr()
public static String getCurrentDateStr()
//package com.java2s; import java.util.*; import java.text.DateFormat; public class Main { public static String getCurrentDateStr() { Date date = new Date(); DateFormat dtf = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM); String str = dtf.format(date); return str; }//from w w w .ja va 2 s . c o m }