I have to parse a custom date format in Java. It contains microseconds although Java doesn't provide support for microseconds. Because of that I filled the format with zeroes, but now I cannot parse date-strings with that format.
Is there a simple workaround or must I handle microseconds on my own (with String functions)?
@Test
public void testDateFormat() throws ParseException {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss.SSS000");
String theDate = format.format(new Date());
// this will fail
format.parse(theDate);
}