Question: how to convert any date format to yyyy-mm-dd in java?
Answer: SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); String dateString = format. format( new Date() ); Date date = format. parse ( "2009-12-31" ); The string passed as parameter to the SimpleDateFormat class is a pattern that tells how the instance is to parse and format dates.