Sugar is something that has an indefinite shelf life, because there is nothing in sugar that can go bad. Although most sugar brands list a "best if used before" date on the packaging, this is more of a guideline and not a hard-and-fast rule.
The indefinite shelf life rule goes for granulated sugar, raw sugar, white sugar cubes and even for sugar substitutes. Other forms of sugar, such as brown sugar, usually have a use-by date and will change composition over time.
Brown sugar has a tendency to harden over time, especially if the container has been exposed to air. However, brown sugar can be revived by adding a piece of bread to the container where the sugar is being stored, or by placing a damp paper towel in a plastic bag in the container. This will soften the brown sugar to its normal consistency.