The calculateTimeDiff task calculates the difference between two timestamps and returns the result as a duration.
Use this task to determine the remaining time (or elapsed time) between a recorded timestamp and today’s date.
In this example:
firstTime property comes from the output of addDuration, another task in the workflow. The reference variable is newtime.secondTime property comes from the getTime task. The reference variable is time.secondTime is less than firstTime, the outgoing timeDiff is a positive reference — for example, the number of days until a future date.
In this example:
firstTime property comes from the getTime task. The reference variable is time.secondTime property comes from addDuration. The reference variable is newTime.secondTime is greater than firstTime, the outgoing timeDiff is a negative reference — for example, the elapsed time since the firstTime deadline was passed.