how to find difference of minutes between 2 time parameter

how to find difference of minutes between 2 time parameter.

For example i have StartTime: 6:00 PM, and EndTime: 7:30PM.

  Discussion posts and replies are publicly visible

Parents
  • There are a few ways to accomplish this one, another option is to subtract the datetime values creating an interval and parse out the result to obtain minutes as:

    a!localVariables(
      local!date1: datetime(2021,9,7,6,30),
      local!date2: datetime(2021,9,7,7,05),
      local!interval: local!date2-local!date1,
      local!days: split(local!interval,"::")[1],
      local!hours: split(split(local!interval,"::")[2],":")[1],
      local!minutes: split(split(local!interval,"::")[2],":")[2],
      
      local!days*24*60
      +
      local!hours*60
      +
      local!minutes  
    )

Reply
  • There are a few ways to accomplish this one, another option is to subtract the datetime values creating an interval and parse out the result to obtain minutes as:

    a!localVariables(
      local!date1: datetime(2021,9,7,6,30),
      local!date2: datetime(2021,9,7,7,05),
      local!interval: local!date2-local!date1,
      local!days: split(local!interval,"::")[1],
      local!hours: split(split(local!interval,"::")[2],":")[1],
      local!minutes: split(split(local!interval,"::")[2],":")[2],
      
      local!days*24*60
      +
      local!hours*60
      +
      local!minutes  
    )

Children
No Data