public long getTimeInMillis (Date startInstant)

Returns the length of the duration in milli-seconds.

If the seconds field carries more digits than milli-second order, those will be simply discarded (or in other words, rounded to zero.) For example, for any Date value x,

 new Duration("PT10.00099S").getTimeInMills(x) == 10000.
 new Duration("-PT10.00099S").getTimeInMills(x) == -10000.
 

Note that this method uses the addTo(Date) method, which may work incorrectly with Duration objects with very large values in its fields. See the addTo(Date) method for details.

Parameters:
startInstant     The length of a month/year varies. The startInstant is used to disambiguate this variance. Specifically, this method returns the difference between startInstant and startInstant+duration.

Returns:  milliseconds between startInstant and startInstant plus this Duration

Exceptions:
NullPointerException     If the startInstant parameter is null.

See also:
getTimeInMillis(Calendar)