Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Labels:
      None
    • Environment:

      Using Railo 3.1.1.0 server installation (on top of Resin) on WIndows

      Description

      DateAdd() returns inconsistent results. When adding 1 month to a certain date, sometimes the result is not correct – instead it is short by 1 or two days. This only happens for some months, not all.

      Demonstrated with the following code

      <cfoutput>
      <table border="1">
      <tr>
      <td>Original</td>
      <td>Add 1 month</td>
      <td>Diff (months)</td>
      <td>Diff (days)</td>
      </tr>
      <cfloop index="i" from="1" to="12">
      <cfset date1 = CreateDate(2009, i, 1)>
      <cfset date2 = DateAdd('m', 1, date1)>
      <tr>
      <td>#date1#</td>
      <td>#date2#</td>
      <td>#DateDiff('m', date1, date2)#</td>
      <td>#DateDiff('d', date1, date2)#</td>
      </tr>
      </cfloop>
      </table>

      </cfoutput>

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                benpate Ben Pate
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: