Parse Date String in Java [duplicate]
This question already has an answer here: Converting ISO 8601-compliant String to java.util.Date 26 answers Java - SimpleDateFormat formatter to return epoch time with milliseconds [duplicate] 6 answers I have date in the format "yyyy-MM-dd'T'HH:mm:ss.sssZ". for example the date is "2018-07-17T09:59:51.312Z". I am using the below code to parse the String in Java. String date="2018-07-17T09:59:51.312Z"; SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.sssZ"); Date transactionDateTime = simpleDateFormat.parse(date); This is giving me "Unparseable date:" Exception.