Calculation of time durations