Last night I made spaghetti alla puttanesca for dinner. I used one of my last remaining tins of anchovies that I had bought some years ago when a local store had an outrageous special on them. How long is "some years"? After reading your post, Ansonman, and yours, Gustavo, I took a look at the tin. It said "best by 12/2009". Not 2019. 2009.
Freshness is generally not a characteristic one looks for in canned anchovies. Some canned and frozen foods foods can last virtually forever, as long as the canning or the frozen state is not compromised in any way. My sense is that the USDA and the FDA have arbitrary rules requiring such expiration dates for most food products, whether they make sense or not, and that this is also the case with similar government agencies in other countries.
I applaud your efforts, Gustavo, but Ansonman's example (2) defies logic on several levels. First of all, "best by" and "use by" dates need to refer to the date of canning, not the date of purchase. Also, all foods are not the same. Chick peas (also known as garbanzos) can last much longer in a can than French-cut green beans, so I would expect them to have a longer "best by" period (and frankly, I would never buy canned green beans in the first place). I can't imagine any way to reword (2) so that it would make sense.
I agree with everything you say about (1). Ansonman, this is a very good example. Your friends that think that "of" should be used with "within" have been taught a convenient generalization that works most of the time, but as Gustavo explains, this is a major exception to that generalization.
I also agree with Gustavo that "from" can often be substituted for "of" in many instances where the object of the preposition is an event that occurs before another event to which it is being compared:
4: In order to be considered for a warranty, the claim must be submitted within sixty days from the date of purchase.
Also, it is possible to use "before" instead of "of" if the order of events is reversed:
5: Based on the direction of flow indicated by the bloodstains, she can't have died within twenty minutes before the collision.
It's a bit awkward, though. I think I'd stick with "of" here. But it is an option. My point, and Gustavo's, is that "within ... of" is a generalization, but not a hard and fast rule.