By analyzing the relation between time and speed, the relation between time and gravitational field, the gravitational redshift of photon and the black-body radiation theorem, the conclusion that time on an object is proportional to the fourth power of the absolute temperature of the object is obtained. Applying the above conclusion about the nature of time, the author analyzes the Mpemba effect and the inverse Mpemba effect, and reaches the following conclusion: the Mpemba effect is the time effect produced when heat flows from objects into space, and the "inverse" Mpemba effect is the time effect produced when heat flows from space into objects.