Round the intervals to properly handle DST

The implicit 'floor' from integer division causes
day ranges that cross the daylight savings time
boundary to be too low by one.  This change uses
normal rounding to give the correct value for such
ranges.

This change could cause surprising results if the
'floor' behaviour is being relied upon in the wild.
Add a test that covers the DST change range.