function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gowtham m 29gowtham m 29 

sum of two time field in formula field

start time__c + Endtime__c--time field 
formula field total hours =???
ankit bansalankit bansal
Hi Gowtham-
This is from the documentation - https://help.salesforce.com/s/articleView?id=sf.custom_field_time_overview.htm&type=5

You can subtract one time field from another in a formula. The result is in milliseconds. For example,
TimeField1__c has the value “10:00pm” and TimeField2__c has the value “9:00pm”:
TimeField1__c - TimeField2__c is 3600000
The result is never a negative number. Subtraction is the difference between two time values, using a 24-hour clock.
For example, when calculating the number of hours a business is open, you use the following formula: (ClosedTime - OpenTime) / 3600000.
ClosedTime = 5 PM, OpenTime = 8 AM, ClosedTime - OpenTime = 9 hours
ClosedTime = 5 AM, OpenTime = 7 AM, ClosedTime - OpenTime = 22 hours