Tuesday, March 21, 2006

SimpleDateFormat

I have always had problems while converting Dates which are generated by the System into a String. Here's a small code for it.

SimpleDateFormat strDate = new SimpleDateFormat("dd-MMM-yyyy");
String dateStr= strDate.format(new Date() );
System.out.println(dateStr);

No comments:

Java 10 Features

My blog post in JournalDev for Java 10 Features