Applying changes from code review notes on better datetime/timedelta handling