It depends. Whole peppercorns, mustard seed, saffron and spices in pods, like cardamom, last longer than ground seasonings such as paprika, chili powder, and garlic powder. Dried herbs and similar spices expire quicker than whole ones, but not as quickly as ground ones. This includes your dried rosemary and oregano.