They knew about and could identify solstices, which gives you day of the year. So then it’s just a matter of matching years, which can be done on the basis of things like comets.
Supernovae could also play a factor. Or using tree rings to identify years mentioned as having droughts or floods.
Probably a bunch of other things we haven’t thought of.