Uploaded image for project: 'Lucee Development'
  1. LDEV-1182

DateDiff months returns one month less than it should

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.0.0.252, 4.5.4.017
    • Fix Version/s: 5.1.4.12
    • Labels:
      None
    • Environment:

      Ubuntu. I haven't been able to test on a more recent version. However, the last commit is from 2015, so I think it's safe to assume that all Lucee versions have this bug.

    • Sprint:
      April 2017 Sprint

      Description

      DateDiff returns one month less than it should when comparing dates that are at the end of the month, if the months in these dates have a different number of days. An example will explain this better:

      	d1 = CreateDate(2017, 1, 31);
      	d2 = d1.add("m", 3); // 2017-04-30 (correct)
      	dump(datediff("m", d1, d2)); // returns 2, should be 3
      

      ACF returns 3 in this case. That is the correct behaviour.

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              jeroenknoef Jeroen Knoef
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: