Fix bug which would have caused the 12am entry to overwrite the previous day's entry.