How to get the current time in YYYY-MM-DD HH:MI:Sec.Millisecond format in Java?
You only have to add the millisecond field in your date format string:
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
The API doc of SimpleDateFormat describes the format string in detail.