Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-441

DateUtils Javadoc does not fully define round() behaviour

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4
    • Fix Version/s: Patch Needed
    • Component/s: lang.time.*
    • Labels:
      None

      Description

      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?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sebb Sebb
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: