[
https://issues.apache.org/jira/browse/LANG-441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707988#action_12707988
]
Valentin Rocher commented on LANG-441:
--------------------------------------
MONTH operation seems well documented for me : quoted from the Javadoc :
"For example, if you had the datetime of 28 Mar 2002
* 13:45:01.231, if this was passed with HOUR, it would return
* 28 Mar 2002 14:00:00.000. If this was passed with MONTH, it
* would return 1 April 2002 0:00:00.000."
MONTH/YEAR add/remove a month or a year depending if we are after or before the
middle of the month/year. However, it seems like the middle is calculated
assuming that each month has 31 days.
> DateUtils Javadoc does not fully define round() behaviour
> ---------------------------------------------------------
>
> Key: LANG-441
> URL: https://issues.apache.org/jira/browse/LANG-441
> Project: Commons Lang
> Issue Type: Bug
> Affects Versions: 2.4
> Reporter: Sebb
> Fix For: 3.0
>
>
> The Javadoc for DateUtils.round() does not define the behavior fully.
> For example, what is the result of:
> round(MINUTE) on 28 Mar 2002 13:10:12.499
> round(MINUTE) on 28 Mar 2002 13:10:12.500
> round(MINUTE) on 28 Mar 2002 13:10:12.501
> round(HOUR) on 28 Mar 2002 13:29:59.999
> round(HOUR) on 28 Mar 2002 13:30:00
> round(HOUR) on 28 Mar 2002 13:30:01
> How are MONTHs/YEARs rounded? Is the time taken into account?
> Does the rounding for February depend on whether there is a leap year?
> What does it mean to round to SEMI_MONTH?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.