I was trying to format a string into date.
For this I have written a code:-
Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateF
If your input is going to be ISO, you could also look at using the Joda Time API, like so:
LocalDateTime localDateTime = new LocalDateTime("2010-10-22"); System.out.println("Formatted time: " + localDateTime.toString());