You can eat chocolate 2 years out of date and even longer as chocolate does not usually spoil and is safe to eat for many years past expiration date.
When chocolate expires it can change in texture and become crumbly and not taste as good as fresh chocolate but it will remain safe to eat.
Most food is safe for around 1 to 3 months after the best by date but it depends on the food.
The length of time that food is safe after the best by date depends on the food and whether it's sealed in a can, in a package etc.
For example eggs are often good for around 3 weeks past the best by date, packaged meats are often good for around a month after the best by date, pasta is often good for around a year or longer past the best by date and canned foods are often good for 5 to 10 years or longer past the best by date although they won't be as tasty.
You can eat expired food if it hasn't been opened depending on the type of food and if it has not actually spoiled.
Canned foods are safe to eat well past expiration date when unopened although foods such as packaged meats, cheese etc are usually only okay for a few months past expiration date.
Canned meats are generally good for 2 years or longer past expiration date when unopened.
Cottage cheese for example is often only good a few months or less past expiration.
It depends on the type of food as some foods go bad quicker than others even when unopened.
Chips for example are often good for a few months past expiration and crackers are good for a few months or so past expiration.
Expiration does not mean the food is always bad but it means that the food is not at it's freshest although some foods go bad sooner after expiration than other foods.
You can eat 20 year old canned food as long as the can is in good shape and not rusty or bulging or leaking.
As long as the canned food can is not bulging, leaking or rusty then the canned food that is even 2 years old, 10 years old, 20 years old or even older past expiration date is safe to eat.
The expiration date on the canned foods does not mean the canned foods are bad after that date as has passed.
The expiration date on the canned foods simply mean that the canned food is not as fresh as it was before expiration date.
While it's best to eat the canned foods before the expiration date it will not harm you if you eat the expired canned foods even if it's 2 years or more past expiration date.
I've eaten expired canned foods that were expired 5 years to 10 years and the food was still safe to eat.
Some people have even eaten canned foods that were 20 years old or older.
When canned food is bad it will smell bad or the can will be bulging, leaky or rusty and in those cases it should be thrown out.