Q:

SimpleDateFormat cannot parse milliseconds with more than 4 digits

I want to parse a timestamp, like this - "2016-03-16 01:14:21.6739". But when I use the SimpleDateFormat to parse it, I find that it outputs an incorrect parsed value. It will covert 6739 milliseconds to 6 seconds with 739 millseconds left. It converted the date to this format - Wed Mar 16 01:14:27 PDT 2016. Why the seconds part has changed from 21 seconds to 27 seconds(an addition of 6 seconds?). The following is my code snippet:
final SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSS");
String parsedate="2016-03-16 01:14:21.6739";
try {
    Date outputdate = sf.parse(parsedate);
    String newdate = outputdate.toString();  //==output date is: Wed Mar 16 01:14:27 PDT 2016 
    System.out.println(newdate);
} catch (ParseException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

A:

SS in SimpleDateFormat is milliseconds. You have 6739 milliseconds, which means you are adding an extra 6.7 seconds onto your time. Perhaps you can truncate the 6739 to 673 (or if you prefer, round it to 674) so it can be parsed correctly as milliseconds.

A:

It seems that is not possible to use SimpleDateFormat to express times with a finer grain than the millisecond.
What is happening is that as you put 6739, Java understands it as 6739 milliseconds i.e. 6 seconds and 739 milliseconds hence the 6 seconds difference observed.
Check these ones, it is explained quite well: 
String-Date conversion with nanoseconds 
Java date parsing with microsecond or nanosecond accuracy

A:

tl;dr
LocalDateTime.parse(
    "2016-03-16 01:14:21.6739".replace( " " , "T" )  // Comply with ISO 8601 standard format.
)

Milliseconds versus Microseconds
As others noted, java.util.Date has millisecond resolution. That means up to 3 digits of a decimal fraction of second. 
You have 4 digits in your input string, one too many. Your input value demands finer resolution such as microseconds or nanoseconds.
java.time
Instead of using the flawed, confusing, and troublesome java.util.Date/.Calendar classes, move on to their replacement: the java.time framework built into Java 8 and later.
The java.time classes have a resolution of nanosecond, up to nine digits of decimal fraction of a second. For example:

2016-03-17T05:19:24.123456789Z

ISO 8601
Your string input is almost in standard ISO 8601 format used by default in java.time when parsing/generating textual representations of date-time values. Replace that space in the middle with a T to comply with ISO 8601.
String input = "2016-03-16 01:14:21.6739".replace( " " , "T" );

Unzoned
A LocalDateTime is an approximation of a date-time, without any time zone context. Not a moment on the timeline.
LocalDateTime ldt = LocalDateTime.parse( input );

UTC
Make that LocalDateTime an actual moment on the timeline by applying the intended time zone. If meant for UTC, make an Instant.
Instant instant = ldt.toInstant( ZoneOffset.UTC );

Zoned
If meant for a particular time zone, specify a ZoneId to get a ZoneDateTime. 
ZoneId zoneId = ZoneId.of( "America/Montreal" );
ZonedDateTime zdt = ldt.atZone( zoneId );

