I believe they know based on the strength and intensity of sunlight they receive and the temperature.