Depends on how it is stored
Moisture leads to mold which ruins hay
Light / uv and excessive heat destroys nutrients
Over time air oxidizes some nutrients and insects often get into it
Vacuum sealed and kept in a cool dark place will last the longest
If fed for its fibre 2 or even 3 year old properly stored hay is suitable but if feeding for nutritients it should be less than a year old