A grand fantasy city-state that has developed a consistent, uniform system of "best by"-dates, not just for food safety reasons and to reduce food waste, but to also significantly reduce crime and conflict between residents. The matter at hand is goblins.
Goblin residents of the city are legal citizens with equal rights just the same as everyone else, but their natural lifestyle differs dramatically from the rest of the peoples living in the city. They are scavengers by nature, having no problems with eating carrion, overripe fruits and plants, and building everything they own from things that other races throw away as junk and trash. As the city produces plenty of waste that goblins would love to take and the city is glad to be rid of, any well-organised city is not just a paradise for goblins, but welcomes them with open arms. They save the city a fortune in waste disposal costs.
Problems mainly arise by differing ideas of what counts as "discarded". Goblins are unfairly labelled as thieves, when they are merely opportunistic and optimistic by nature, and will interpret any unclear situation to their own benefit, and will argue "how was I supposed to know that you still wanted it?" over things that looked lovely and were left unattended. And while yoinked items of clothing and other tools are easily returned or financially reimbursed (paying for what they already took is the only use that goblins have for money, which they do not steal), but foodstuff is gone faster than you can blink.
So, the city needed to determine laws for how to define and clearly label when consumable goods are no longer fit to most peoples' consumption, both to help people keep track on how old their groceries are, and also to mark them for goblins. So even though the food that's past the date on it can still be good to eat, it might also be gone by the next time you reach for it.