Disclosed is a method for displaying whether drinks, such as fresh milk, are within shelf lives according to whether a light-emitting component emits light. In the method, a shelf life is a variable time that takes a quality guarantee time at an ideal storage and transportation temperature as a reference, and shortens with a decrease in the freshness and an increase in a storage and transportation temperature. A light-emitting time of the light-emitting component is equal to the variable time and is used for displaying the variable time. A battery provides energy to the light-emitting component. The light-emitting component and the battery are connected between two electrodes in series. The two electrodes are oppositely arranged in a drink in parallel, and the distance D between the two electrodes and an active area S of a single electrode satisfy RS = ρD, wherein ρ is the resistivity of the drink at the maximum allowable storage and transportation temperature, R is the equivalent resistance between the two electrodes and is determined by Vc - Vmin = RImin, and Vc, Vmin and Imin are respectively a voltage of the battery, and the minimum working voltage and the minimum working current, i.e. the minimum light-emitting current, of the light-emitting component. A capacity C of the battery is determined by IminT, wherein T is a quality guarantee time at the maximum allowable storage and transportation temperature.