Getting the Date format in Java [duplicate]
问题 This question already has answers here : Java string to date conversion (13 answers) Closed 6 years ago . I am have this String from a Date object: Mon Mar 25 00:00:00 IST 2013 What is the String representation of the date format? 回答1: The code below should work fine. public static void main(String[] args) throws Exception { String target = "Mon Mar 25 00:00:00 IST 2013"; DateFormat df = new SimpleDateFormat("EEE MMM dd kk:mm:ss z yyyy", Locale.ENGLISH); Date result = df.parse(target); System