how to convert a date dd / mm / yyyy to yyyy-MM-dd HH:mm:ss Android [duplicate]
问题 This question already has answers here : What's the best way to parse an XML dateTime in Java? (9 answers) Closed 3 years ago . How can I convert a date in dd / mm / yyyy to a format that supports sqlite yyyy-MM-dd'T'HH: mm: ss for example: public static String convertStringToData(String stringData) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/aaaa");//yyyy-MM-dd'T'HH:mm:ss SimpleDateFormat output = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date data = sdf