Brewers use a variety of ways to date their kegs. Knowing when the keg was filled (kegged on date) is the first step in determining if the keg is fresh or not.
The video explains how to read date codes.
Go here for the shelf life of different brands of beer:btbr.co/fresh