You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/12/20 13:27:54 UTC

DO NOT REPLY [Bug 26659] - [lang] add method to DateUtils to get the distance between 2 dates

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=26659>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=26659





------- Additional Comments From Maarten.Coene@qmedit.com  2004-12-20 13:27 -------
>The variableDistance handling is a bit of a worry. Increasing by one until we
>equal that point. Working out difference between two months separated by 400
>years will take quite a while.

I agree this can be a problem, but I'm sure it can be done more efficiently. If
there is a chance that this code gets accepted, I'll submit a new patch with a
faster algorithm.

>I could see this on a CalendarUtils, or DurationCalendarUtils, but I'm not
>convinced of the need for it.

I use it very frequently to determine the age (in years) of a person when only
his/her birthdate is available (for adults: this is expressed in years, for
young children this is expressed in months en for babies this is expressed in
weeks).

>the functionality
>for Month/Year seems very open to user interpretation.
>Exactly how many years are between 1st Sept 1980 and 1st Mar 1981? 1, 0.5 or 0?

The javadoc should make sure there is only 1 way to interpret this
functionality. Perhaps the suggested javadoc can be rewritten to avoid these
questions.

regards,
Maarten

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org