Octal numbers
(2014,03,31)
Beware: Prefixing a numeric literal in Java means octal base-8 numbers rather than decimal base-10 numbers. Drop that leading zero: (2014,3,31)
Avoid legacy date-time classes
Update for modern Java: Avoid using the terribly flawed date-time classes from the early days of Java. These have been supplanted by the java.time classes built into Java 8+.
java.time
LocalDate
For a date-only value, use java.time.LocalDate class.
LocalDate begin = LocalDate.of( 2014 , 3 , 31 ) ;
ChronoUnit.DAYS
If you just want the number of days between two dates, just use the ChronoUnit.DAYS enum with its convenient between method. Note the result is a long, not int.
long days = ChronoUnit.DAYS.between( begin , end ) ;
Milliseconds
Your Question asked about milliseconds. I suspect that is only because of the feebleness of the legacy classes. But just in case…
ZoneId
To count millisecond, your need the first moment of the day. Determining first moment requires a time zone. The day starts many hours earlier in Tokyo Japan than in Toulouse France, and even more hours later in Toledo Ohio US.
ZoneId z = ZoneId.of( "Asia/Tehran" ) ;
ZonedDateTime
Always let java.time determine the first moment. Never assume the day starts at 00:00. Some days on some dates in some zones start at another time, such as 01:00.
ZonedDateTime zdtBegin = begin.atStartOfDay( z ) ;
Do the same for the end.
Duration
Calculate the elapsed time on a scale of hours, minutes, seconds, and nanoseconds with the class java.time.Duration.
Duration duration = Duration.between( zdtBegin , zdtEnd ) ;
To get a count of milliseconds while ignoring any microseconds and nanoseconds, call toMillis.
long millis = duration.toMillis() ;
GregorianCalendar.java.timeones