I accidentally ate some packaged shredded cheese without knowing its expiration date. It expired in December and it is now February. it tasted fine, and it wasn't moldy. will I be okay? or should I worry about being sick? if so, how long would it take for me to get sick?
Speaking in general about expiry dates, because I haven't seen them posted in other answers to this or other questions...
Expiry dates are (in some jurisdictions) entirely optional for most goods, and determined by the manufacturer (one example, anecdotally).
Another recent-ish article, which I found enlightening, from National Geographic that suggests that strict adherence to these "dates" results in wasted food that's perfectly safe. There's no doubt a balance between economics... and helpful suggestions for general health/safety.
There's clearly also examples and counterexamples: food that's spoiled before the expiry date because of poor storage, contamination, etc.; unopened shelf-stable food that might be safe indefinitely.
Plenty more questions about this topic, in general, also by searching SA for "expiry" and/or "expiration" in addition to the other suggested search topics.
Be safe out there! :)
It may well be a can of worms, but your question is very valid when, according to Wikipedia:
every year in the USA there are 76 million foodborne illnesses, leading to 325,000 hospitalizations and 5,000 deaths.
That aside, it is worth pointing out the facts about hard cheese and its longevity. Firstly it is a high fat product. Fat goes rancid, not bad unless it develops mould. Therefore if it looks mould-free, smells and tastes fine, there will be no problem. Indeed, even if the cheese has developed a mould, it does not necessarily mean it will make you ill, as the human gut has been made to deal with many moulds which naturally occur.
Historical facts: hard cheese was "invented" as a way of preserving a product made in times of plenty, to see over the times of hunger. The inherent properties and content (fat and salt) are long-life products which no amount of industrialisation can destroy. These cheeses include Cheddar, Parmesan, Emmenthal and Edam.
My personal experience: I currently have cheese in the refrigerator bought abroad and three-four months past its "use by" date. This happens regularly every year, because I cannot live without my Extra Mature Cheddar. At no time have we ever been ill as a result of eating out of date cheese. HOWEVER, it is not low-fat nor grated. If grated cheese is nearing its best-by date and you do not intend using it in the near future, simply pop it into the freezer.
Shelf Life A UK initiative to reduce food-waste may be of interest. WRAP (Waste & Resources Action Programme) is a registered UK charity working with "businesses, individuals and communities to achieve a circular economy through helping them reduce waste, develop sustainable products and use resources in an efficient way". It is pertinent that the whole "use by" labeling is being scrutinised. According to WRAP, 33% percent of all food produced is wasted along the cold chain or by the consumer. At the same time, a large number of people get sick every year due to spoiled food.
Which brings us back to your question of how long will it take before you get sick if the cheese was "bad"? The incubation period i.e. the time between eating contaminated food and the onset of symptoms, can be as short as a few hours or as long as several weeks. Hard cheese is less likely to cause serious food-poisoning, but Salmonella and Listeria and other bacteria may be found in a range of chilled, ready-to-eat foods including cheeses such as soft blue cheese, Brie and Camembert. It will also develop and grow in a refrigerated environment more information here It is also worth mentioning most deaths from food poisoning are from E.coli and Listeria, with the very young, the aged and those with a compromised immune system at greatest risk.
You're fine. Cheese gets moldy when it goes bad. If it looked fine, and tasted fine, you have nothing to worry about. Cheese is often aged for years upon years, and for safety's sake we say to leave a bit of buffer if you cut off mold from a solid chunk of cheese, the rest is still fine to eat. Of course, if shredded cheese gets moldy, you throw it out, but you would have seen mold.