The ocelli of insects sense day length via a small lens and pigmented retinal cells.
“Each ocellus usually consists of a small lens backed up by several pigmented retinal cells, which can determine the quality and source of light and usually perceive something moving nearby. Ocelli usually look like small dark dots, and are often grouped in a triangle on the back of an insect’s head. They enable the insect to judge the length of daylight, for example, by which it may regulate its whole life cycle. Spiders’ eyes form extremely good images and have, for their size, excellent resolution.” (Foy and Oxford Scientific Films 1982:122)