How to convert a date having ordinal format 1st March 1994?
问题 I want format a date given in the following format 1st March 1990. The date should be formatted to YYYY-MM-DD. I have the following code. It gives me an unparsable date. From this i can understand, this is not the correct way to format this date as its not a valid pattern. public class DateFormattingTest { public static void main(String[] args) throws ParseException { String dateString = "1st March 1984"; dateString = dateString.replaceFirst("[a-zA-Z]{2}","") ; SimpleDateFormat