Whole dried allspice can keep without a time limit if they are properly kept in airtight jars. They also must not face the light. It can be ground in a mill or an electric coffee grinder. After it is ground, the spice loses its flavor in a few days.