adding datetime_to_durations helper function plus tets