I have to use a custom date format in Java. It contains microseconds although Java doesn\'t provide support for microseconds. Because of that I filled the time pattern with
In addition to jarnbjo's answer, if you need the microseconds, you might be able to use java.sql.Timestamp:
Date dateToMillis = format.parse(theDate.substring(0, 23));
DateFormat timestampFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
Timestamp timestamp = Timestamp.valueOf(timestampFormat.format(dateToMillis) + theDate.substring(23,26));