Fix date tick over not at midnight

It's a miracle the old code worked at all!