I have a few different types of flakes and pellets that are more than 1 year old. They don't have an expiration date, but obviously they cannot last forever.
the best way to make sure your fish food is still good is to only buy enough for about 2-3 months of feeding. that said, alot of people buy their fish food in bulk and will freeze the dry foods so that they retain their nutritional value.
Yea, my hikari wafers went stale recently... the fish don't seem to mind, they hit them HARD. Soaking pellets/wafers in a vitamin supplement does help restore nutritional values..
I would advise against using stale foods to fish. They are one of the many reasons why fish suffer digestive problems. IMO, if a package has been opened several times beforehand and had lapsed two months, it's time to throw that in the bin. A month for flakes since flakes by this time have degraded rapidly. Vitamins are easily destroyed by air and light alone.