How can I calculate the number of hours between two date and time fields?

How can I calculate the number of hours between two date and time fields?

To calculate the number of hours between two date and time fields, add a formula field and specify the formula expression as ((To_Date - From_Date) / (1000 * 60 * 60))

 

form  Sample
{
FromDate
(
type = datetime
)

ToDate
(
type = datetime
)

Hours
(
type = formula
value = ((To_Date - From_Date) / (1000 * 60 * 60))
)

}

    • Related Articles

    • How can I calculate the number of days between two date fields?

      To calculate the number of days between two given date fields, for instance, ServiceStartDate and ServiceEndDate, add a formula field to the form with formula expression as below. ((ServiceEndDate - ServiceStartDate) / (1000 * 60 * 60 * 24)) ,where ...
    • Formula custom fields

      A formula field will automatically calculate and derives its value by referring to the value of the specified fields or the numeric, text, or date values given in the formula. You can customize fields with formulas using functions like numeric, ...
    • Creating Formula Fields

      Formula fields are used to calculate different types of values, including numeric values, text values, date values, etc. Formula fields and their resulting return value have certain data types associated with them and there are specific operators ...
    • Date-field Autoresponder

      Understanding date-field autoresponder Date-field based autoresponders are a series of automated messages that are sent to contacts based on the date in the date field associated with them. Wishing customers happy birthdays and anniversaries are ...
    • Task layouts & fields

      Zoho Projects supports custom fields and layouts for tasks. Create your own fields and task layouts and use them for creating tasks as per your business requirements. Click here to learn more about access privileges for Custom Fields and Task ...