Change API so it works when a midnight boundary is crossed.