import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class DateUtils {
public static void main(String [] args) {
Calendar cal = Calendar.getInstance();
Date d = cal.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy HH:mm aa");
String documentDate = sdf.format(d);
System.out.println(documentDate);
}
}
import java.util.Calendar;
import java.util.Date;
public class DateUtils {
public static void main(String [] args) {
Calendar cal = Calendar.getInstance();
Date d = cal.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy HH:mm aa");
String documentDate = sdf.format(d);
System.out.println(documentDate);
}
}
Sample output
Mar 28, 2016 11:36 AM