GetEffectiveDuration - Same date

I'm currently trying to calculate the number of days, hours and minutes between 2 dates - the date task is created (set in an activity event expression on enter of form - assigning DateTime.Now to "DateCreatedMain" Xpath) and the completion date - which is the DateTime.Now in the current expression.

So I have used this function:

<Workflowtask.PerformanceMeasurements.TimeCompletedMain> = CHelper.getEffectiveDuration(Me,<Workflowtask.ProcessDate.DateCreatedMain>,DateTime.Now);

CHelper.trace("Dur", "EffDur= "+<Workflowtask.PerformanceMeasurements.TimeCompletedMain>);

This is supposed to return the result in minutes, however, the result is always 0 - see trace below:

8/24/2018 1:02:05 PM: [EffDur= 0]

8/24/2018 1:02:05 PM: [Now= Fri Aug 24 12:58:30 UTC+0 2018 Created= Fri Aug 24 12:56:48 UTC +0]

There is roughly 2 minutes between the two dates, so why am I not getting 2 as the returned value?

Comments (1)


Dear Kristian

We are unable to reproduce this issue and were able to see the time difference by following your exact steps.

Please let us know your Bizagi version.

Also, please note that the function "getEffectiveDuration" considers the organizational working time schema. Thus, the date difference will not include non-working periods of time. Therefore, please make sure you start and finish the task as per the working time schema.

We look forward to hear from you.

Best Regards