I have kept butter frozen (in its sealed wrapper) for a year with little to no obvious effect on taste. open to the air, it will not last that long, and can go bad in a week defrosted if left uncovered.
In the fridge, it will last months if kept sealed.
Butter may be kept at room temperature for 1 to 2 days, but it will begin to spoil rapidly if not refrigerated after that. To further extend the shelf life of butter, freeze it: to freeze butter, wrap tightly in heavy-duty aluminum foil or plastic freezer wrap, or place inside a heavy-duty freezer bag.
Margarine is a chemical compound.
When refrigerated: Margarine lasts for 4-5 Months
When opened, 1-2 months.
Butter and margarine can be kept frozen for nearly a year. In the fridge, well in my house it rarely lasts more than 2 weeks since I cook with it(butter). I don't use margarine.
If it still tastes good I'd eat it. You can leave butter out of the fridge for at least a week, I do that because it's easier to spread that way. In the fridge it lasts months, in the freezer, probably a year.
Atleast two weeks, no more no less. Once it is two weeks past the expiration date, the only thing you can use it for is to lube up the ol' prune shoot on old besse and let er' rip. . . . .you be gon' ta town like an old jockey tryin' break a record at the Kentucky derby