Beans that go into an opaque container that is not totally airtight are fresh for two weeks max. Packaged beans with a degassing valve are fresh for six months or longer in the bag. Beans, once ground, cannot be used after two hours (that being said, ground coffee starts losing flavor immediately).