You could try this:
- use floor(minutesBetween($start, $end)) to get $duration in minutes as an integer
- use floor($duration : 60) to get $hours
- use $duration mod 60 to get remaining $minutes
- use the StringLeftPad java action in CommunityCommons to format toString($hours) and toString($minutes) as a two character string with leading zeroes if necessary
- finally concatenate using $leftpaddedHours + ':' + $leftpaddedMinutes
Edit: you could also do the following:
minutesBetween($start, $end) as $duration
formatDecimal(floor($duration : 60), '00') + ':' + formatDecimal(floor($duration mod 60), '00')
Hey Shailja, since you also want the number of minutes, I'd suggest using minutesBetween the two dates and then formatDateTime($minutesBetween, 'HH:mm').