Just idly wondering really, the DateTime class in the awesome JodaTime library has a
minus(long millis)
method, which returns a new DateTime object minus the specified number of milliseconds, so why would I ever need the
minusMillis(int millis)
method, which does the same but with an Integer number of milliseconds? Integer.MAX_VALUE in milliseconds is only 24 days, which isn’t that helpful, and presumably it just converts the int to a long and pumps it into the other method anyway?
The JodaTime library is so well written that I figure there’s probably a reason that I’m missing.
http://joda-time.sourceforge.net/api-release/org/joda/time/DateTime.html#minusMillis(int)
EDIT: To clarify, I’m wondering why I should use the minusMillis(int) method – I understand what the more powerful minus(long) method is for.
I suspect its because in version 1.0 there way only the
minus(long duration)method but in version 1.1 there wasminusXxxx(int units)added resulting inminusMillis(int)being add for consistency andminus(long)was not removed for back-ward compatibility.BTW: there is a
plus(long duration)and aplusMillis(int millis)for, I imagine, the same reasons.