The best-case scenario is that coffee is used within two to four weeks from roasting for peak flavor.
It is Important to Know your roaster Master and Know the Quality of the beans being Roasted. Usually, coffees like Starbucks, Dunkin Donuts, and Coffee Shops in town are old and tasteless. They don't know went the coffee was Roasted or Who did it.
While there are a number of opinions on how to store coffee, our best recommendation is to store whole bean coffee either in the original packaging—sealed tightly with the excess air forced out of the bag via the one-way valve—or in an airtight container that allows carbon dioxide to escape without letting oxygen in. In either case, coffee should be stored in a cool, dry space and away from direct sunlight. Once opened, it’s best to use the coffee within a two-week period for best results.