In a shell script I would like to calculate the difference between two timestamps.
It should look like similar to:

do something
elapsed=calcdiff($mystart, $myend)
echo elapsed time=$(elapsed +%d:%H:%M:%S)

However the script above does not work.

Further question when the runtime is greater than 31 days does %d above then contain e.g. "35"
or does it contain a value modulo 31 (here: 4) ?