Coffee doesn't have a definite expiry date, so the best way is to use your senses. When coffee loses its flavor and aroma, you know that it has gone bad. Freshly roasted beans last around three months, and fresh ground coffee for a few weeks or up to a month. That's because ground coffee has more surface to contact with oxygen. It also depends on how you store your coffee to stay fresh for a longer time. You can use appropriate bags such as sealed, one-way valve foil bags with pinholes. These bags let the gas out and don't let the air in.