Calculation of 2 Dates formatted to minutes

Issue #26 resolved
D Ng created an issue

Hi fcarmario,

I am trying to find the difference between 2 fields and then convert them into minutes. As of right now, my formula goes as follows: {End Time}-{Start Time}/{MINUTE}

I end up with this: JIRA WF TB 2.PNG

So then I would go and create an issue and pick out the dates 26-Feb 10:20AM (Start Time) and 26-Feb 10:40 (End Time) --> Which should return 20 minutes but instead I get a date returned instead of the difference in minutes: JIRA WF TB 1.PNG

Any ideas on why this isn't working??

Comments (4)

  1. Fidel Castro Armario repo owner

    Hi Devin,

    There are two things to be corrected:

    1.- Target field must be a "Number" instead of a "Date", since you are obtaining the number of minutes.

    2.- You should use parentheses (brackets) to force subtraction to be evaluated before division, since "/" has greater operator precedence than "-". Use something like: ({End Time}-{Start Time})/{MINUTE}

    Regards,

    Fidel.

  2. D Ng reporter

    Thanks Fidel! I will give this a try and update this page with my results.

    In addition, would making the custom field a "Number", opposed to "Date", allow users to input a Date and Time (formatted as 26/Feb/14 10:40) and still make a calculation?

    Best Regards,

    Devin

  3. Log in to comment