• Resolved Graicifyd

    (@graicifyd)


    How do I find the difference between 2 dates fields, such that the result is in days, hours, minutes and seconds.

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

    (@codepeople)

    Hello @graicifyd

    You can use the “DATEDIFF” operation in the date/time operations module.

    Assuming you have two date time fields, fieldname1 and fieldname2. You can implement the equation as follows:

    (function(){
    var obj = DATEDIFF(fieldname1, fieldname2, 'mm/dd/yyyy', 'd');
    
    return CONCATENATE(obj['days'], ' days, ', obj['hours'], ' hours, ', obj['minutes'], ' minutes, and ', obj['seconds'], ' seconds');
    
    })()

    Learn more about the Date/Time operations module by reading the following section in the plugin documentation:

    https://cff.dwbooster.com/documentation#datetime-module

    Best regards.

    Thread Starter Graicifyd

    (@graicifyd)

    Excellent, thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Difference between 2 dates’ is closed to new replies.