Difference between time in seconds

Hi All,

I know it sounds bit simple but I’m not able to get the difference between two time fields in seconds.
I have an object with two time properties(From and To)and I’m trying to get the difference on the change of any of these two fields in seconds.
I have created a composite field of type Numeric calculation and output base format as time but I’m not getting the correct result.

Thanks,
Vishal

Hi Vishal
I have moved your question to Build Advice. Definitely fits there! I’ll get one of our propeller heads to come back to you soon as.
Cheers, Tony

Hi Vishal,

What version of the platform are you using?

Richard

Hi Vishal,

I’ve assumed you’re on a v10+ version.

Create two composites from the two date time fields with function “Add Interval (returns timestamp)”, the interval subject can be left to default days and the interval value set to 0:

The create another composite of type “Numeric Calculation” with the output base format of Integer:

The calculation is “Second Composite – First Composite”:

The output of that composite is the time difference in seconds.

Richard

Hi Richard ,

I’m using 10.0 version.

Thanks,
Vishal

Hi Vishal,

Great, my reply above should work for you then.

Richard

Thanks Richard . That worked for me .
I was wondering how to trigger the calculation on the change of time 1 and time 2 property . As of now, difference is calculated only when the values are saved on click of submit.

Hi Vishal,

It’s only possible at the point you save the value.

If you need this to recalculate without submission then the only option would be a Code Studio callback function. That would also require a later version of the platform so you’d need to schedule an upgrade via your Account Manager.

Richard

Thanks, Richard.
I will check for the upgrade .