Greetings!
Most batteries will have a date code stamped in the case, or on a sticker. It will start with a letter which is the month of manufacture. A=January, B=February, etc. The next 2 numbers are the year of manufacture. B18 would be Feb, 2018. I try to get batteries that are no more than a couple of years old, meaning they should last me at least 5 more years.
I take a multi-meter with me, and if it reads over 12v it should be good because it has been sitting. Of course you want a deep cycle battery.
There are at least 2 kinds of battery recyclers. Some just sell used batteries, while others actually recondition them. If they’re good, a reconditioned battery can be as good as or possibly better than it was when new. Good reconditioned batteries usually come with a 5+ year free replacement warranty. The problem is that the warranty is only good at that business. Reconditioned batteries usually sell for between $30-$50, while used batteries can often be found under $20. Used batteries may or may not have any type of warranty.
I’ve been buying used batteries for decades now, and they usually last 5-7 years. (WITHOUT SOLAR!!!) With solar, I have never had a battery last longer than 2 years, and under a year was more typical, and that was with brand new $350 batteries. Solar kills batteries prematurely with it’s poor charging characteristics.
Cheers!