Previously it would give a bad result for one day every 1024 days. (cherry picked from commit b1b4e42c)