How to date your foodstuffs

Whet Moser, suddenly making sell-by dates on food products relevant to me:

About a quarter of US methane emissions comes from food rotting in landfills.

The dates on our packaged food products look so authoritative, but the way Moser tells it, they were invented by marketing folks to increase sales at the cost of disposing of otherwise good products that have an expired sell-by date.