The Time difference calculation field is used to calculate the difference between two time fields or time calculation fields in a form. An advanced property determines what the difference is in hours, minutes or seconds and the value is rounded to the nearest whole number. Time difference calculation fields can be used in event, profile and database forms. They are not yet supported in the Smartabase Athlete or Kiosk applications.
The example above is a training log form for coaches or athletes to record information about a training session. The form contains a Time difference calculation named Session Duration to return the session duration in minutes. The Time difference calculation cannot directly reference the event start and finish times located at the top of the form, so two time calculation fields (named Session Start Time and Session Finish Time) are used to return the event start and finish times.
To set up the Time difference calculation, the from date has been set as the Session Start Time and the to date has been set as the Session Finish Time. The calculation returns the difference between these times in minutes.
A Time difference calculation can also be used to calculate sleep duration in a wellness monitoring workflow. For more information on how to set up this workflow, check out our tutorial on calculating sleep duration.