"within" can in fact be used with the preposition "of," as in this example from the Longman dictionary:
- Within an hour of our arrival Caroline was starting to complain.
Example (1) is fine to me. "of" and "from" could not be used in this case in which a clause follows. The present perfect could be used in the time clause:
(1') Everyone will receive a raise within five days after the management and the union have reached an agreement and completed all the paperwork.
In (2), both "from" and "of" work (notice that a noun --or a gerund-- needs to follow). I find the question too awkward and confusing:
(2) John asks me, "Within what period from the date of purchase do you choose canned foods that are safe to eat?"
The way it is written, "within what period" seems to refer to the time of choosing, not to the food specifications. How about this?:
(3) What is the shortest best before/use by dates of the canned foods you (choose to) buy?
Answer: "I usually choose canned foods that expire within one year of/from the date of purchase."
I'm sure my colleages here will come up with better options.