• Resolved sallam

    (@sallam)


    I need help to create a form that allows my users to calculate the hours passed between 2 times, where they select in “From” and “To” fields.. a date and hour, to get the number of hours between the 2 times.

    Example:
    From: 9am, 17-08-2023
    To: 11am, 19-08-2023
    Result: 50 hours

    What formula should I use please?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @sallam

    Thank you very much for using our plugin.

    You can use the DATEDIFF operation. Assuming the date/time fields are the fieldname1 and fieldname2, you can insert a calculated field and enter the equation:

    DATEDIFF(fieldname1, fieldname2, 'yyyy-mm-dd hh:ii', 'h')['hours']

    Best regards.

    Thread Starter sallam

    (@sallam)

    Thanks very much. Actually, I used a simple minus and multiplied by 24 to get the number of hours, and it worked!

    But how can I remove the (dd-mm-yyyy HH:mm) text, since the users don’t type the date or time, but rather select them from your elegant date selector!

    https://my2cents.gawaher.com/?cff-form=68

    • This reply was modified 1 year, 3 months ago by sallam.
    Plugin Author codepeople

    (@codepeople)

    Hello @sallam

    Please, enter the style definition below through the “Customize Form Design” attribute in the “Form Settings” tab:

    #fbuilder .dformat{display:none;}

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘time calculator’ is closed to new replies.