How can we get difference between two times ?

Hi All,

I am having two times saves in 2 variables 

Eg: 1)  2/5/2023 9:00 AM GMT+05:30.  2)   2/5/2023 8:00 PM GMT+05:30

now my ask is what function we should use in order to get the output like output : 11 hrs or in minuts

and also same for dates 

Thank you 

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Senior Developer
    in reply to nikkheelm4742

    ah, so you don't have the plugin, my bad, here's the equivalent of the above but by using Appian built-in functions:

    a!localVariables(
      local!firstDateTime: now(),
      local!secondDateTime: now() - intervalds(28, 15, 0),
      local!differenceTimeValue: timevalue(
        local!firstDateTime - local!secondDateTime
      ),
      a!map(
        mintuesDifference: minute(local!differenceTimeValue),
        hoursDifference: hour(local!differenceTimeValue),
        hoursWithMinutes: local!differenceTimeValue,
        dateDifference: days360(
          local!secondDateTime,
          local!firstDateTime
        )
      )
    )


    edit: note that if you want to get the total hours or minutes difference, then you should add the hours or minutes with the days difference (* 24) or (* 24 * 60 (incase of the minutes)) .

Children