A New Faster Algorithm for Gregorian Date Conversion
benjoffe.com·10h·
Discuss: Hacker News, r/cpp
Flag this post

…how “Century-February-Padding” beats traditional year slicing.

3 November 2025

This is the first of a series of articles in which I outline some computer algorithms that I have developed for faster date conversion in the Gregorian calendar.

Most computer systems store dates as a single integer counting days or seconds since an epoch such as 1970-01-01 (UNIX time). Converting that integer to a Year, Month and Day is a fundamental calculation made in almost all programming languages and standard libraries.

In 2021, Cassio Neri and Lorenz Schneider developed the Neri‑Schneider algorithm , which is, to my knowledge, the fastest publicly documented algorithm for performing the above calculation. It has since been implemented in seve…

Similar Posts

Loading similar posts...