Given your entry 2014-09-17T12:00:44.0000000Z , this is not enough to avoid the letter T You must also handle the final Z But keep in mind that this Z NOT a literal, but has a UTC+00:00 timezone offset in accordance with ISO-8601-standard . Therefore, avoiding Z NOT correct.
SimpleDateFormat handles this special char Z pattern X character. So, the final solution looks like this:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSX"); Date d = sdf.parse("2014-09-17T12:00:44.0000000Z"); System.out.println(d);
Note that for the time zone, the correct CEST clock time ( toString() uses the system time zone), and the result is equivalent to UTC-time 12:00:44 . Also, I had to insert seven S characters in order to properly process your input, which pretends to have an accuracy of up to 100ns (although Java pre 8 can only process milliseconds).
source share