How to convert current date into string in java?

user354299 picture user354299 · May 31, 2010 · Viewed 206.6k times · Source

How do I convert the current date into string in Java?

Answer

Ian Purton picture Ian Purton · Feb 21, 2013
String date = new SimpleDateFormat("dd-MM-yyyy").format(new Date());