Good evening everyone!
My form sends a String list in this format:
dd/ MM / yyyy
Wanted converts this string list in date to the format :
yyyy - MM - dd
How can I do this in Java ?
Good evening everyone!
My form sends a String list in this format:
dd/ MM / yyyy
Wanted converts this string list in date to the format :
yyyy - MM - dd
How can I do this in Java ?
Date today;
String output;
SimpleDateFormat formatter;
String pattern ="yyyy-MM-dd";
formatter = new SimpleDateFormat(pattern, currentLocale);
today = new Date();
output = formatter.format(today);
System.out.println(pattern + " " + output);
http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html