Fix end time normalization calculation

End time calculation incorrect when close to end of the hour. Add test
to show problem and fix by using Python datetime timedelta calculation.