The next new moon, after the heliacal rising of Sirius, which happened in the last month of the calendar year, marked the New Year.
And because the ancient Egyptians were using the lunar cycle in combination with this heliacal rising, some years ended up having 12 lunar months, while others had 13 lunar months, if Sirius didn't rise in the 12th month.
Even though the length of the agricultural calendar still fluctuated, with some years having 12 months and others having 13, it ended up being much more reliable than it was before.
They continually adjusted it to the heliacal rising of Sirius, ensuring that they never got too far off in their seasons.
This new calendar was ideal, because, well, it worked well for agricultural purposes as well as for knowing when to have traditional religious festivals.
So, that was their first calendar.
But was it any way to run a government? They didn't think so.
For administrative purposes, it was very inconvenient to have years of different lengths.
So another calendar was introduced, an administrative one.
Probably soon after 3,000 BC, they declared a 365-day year, with 12 months per year, with exactly 30 days each month, with an extra 5 days at the end of each year.
This administrative calendar existed alongside the earlier agricultural and religious calendar that depended on the heliacal rising of Sirius.
This administrative calendar was much easier to use for things like scheduling taxes and other things that had to be paid on time.
Over time, the calendar got out of step with seasons and the flooding of the Nile, but for bureaucratic purposes, they didn't mind.