Calculate time gap between two dates