M&Ms and Mars candy: There's usually a 10-digit code of numbers and letters, but you only need to worry about the first three. The first number is the last number in the year ... and the next two numbers stand for the week of the year (... 804 would be the fourth week of 2008: February 2008).
Hershey's: There's a 2-character code for the month and year. The year is like the other code, with the number being the last number in the year, the second character is a letter that represents the month. A = January, B = February, and so on. So a code like 9A would mean ... January 2009.
And be sure to visit your dentist in 8J.