The TimeOfDay control accepts the format hhmmss. You can calculate the duration in hours between two times in two ways:
Extract the hours from both properties and assign them to parameters (of type integer). Then, perform a subtraction operation and map the result to the Duration property.
Use the FormatDateTime function to format both input properties (TimeOfVisit and EndTimeOfVisit). Use these formatted values in the DateTimeDifference function to get the difference in hours.