The problem here is not that the milliseconds are not getting parsed, your startTime
includes the milliseconds you have provided. The problem is that they are not getting printed.
You need to format your output if you want something other than the default format from Date#toString()
:
Converts this Date object to a String of the form: dow mon dd hh:mm:ss zzz yyyy
You can use your SimpleDateFormat
to format your output too, which will give you milliseconds:
System.out.println(sdf.format(startTime));