compute_duration function

Compute duration between two dates