Gasoline has a shelf life also, particularly modern gasoline blended with ethanol and other additives. Ever had trouble using last year's gasoline in the lawn mower the following spring?
Diesel generally stores better, but it can have problems with algae growth.