1. Easiest is to save the %starttime as the $ctime it was at the start and %finishtime at the finish. Then you can simply subtract %finishtime - %starttime, run that through $calc( ) and then get the $duration( ) of the final $calc result.
- $duration($calc(%finishtime - %starttime))
2. Another strategy is to just use $date with the %starttime and $date with the %finishtime to run through $ctime to convert them both to ctimes, then follow the same steps as above.
- $duration($calc($ctime($date %finishtime) - $ctime($date %starttime)))
The first way is far superior to the second for many reasons but requires a change in how the %starttime and %finishtime are stored initially. The main reason is that the $date may have changed from what it was at %starttime.