Question: how to convert dd-mm-yyyy to yyyy-mm-dd in android?
Answer: SimpleDateFormat originalFormat = new SimpleDateFormat("dd MM yyyy"); SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy MM dd HH:mm:ss" ); Date date; try { date = originalFormat. parse("21 6 2013"); System. out. println("Old Format : " + originalFormat.