Biologists have long suspected early mammals were nocturnal, taking advantage of (most) dinosaur sleeping patterns, and only shifted to daytime activity after their fearsome competitors disappeared. Although this makes sense, it's been very hard to prove, but now a study of thousands of species provides powerful evidence for the theory. The legacy of a nocturnal past has survived in most mammals' retinas.
If you were designing an eye for nocturnal and diurnal species you would produce something very different. Since evolution doesn't start from scratch, not all animals have eyes with architecture best suited to their current lifestyle, a fact that remains one of the best pieces of evidence against claims of “intelligent design”.
Fish, reptiles, and birds that hunt in daylight have a part of the retina called a fovea that sharpens their vision in well-lit conditions by packing lots of light receptors together. Among mammals, however, only certain primates, ourselves included, have a fovea. Similarly, the color-blindness of most mammals, a result of only having two types of optical cones rather than three or even four, is a hindrance to hunting during the day, but not one large enough to stop mammals becoming the apex predators of most ecosystems.
The theory that this pattern is a result of a nocturnal past for mammalian ancestors dates back to the 1940s but has been hard to prove, since fossils seldom tell us when an animal was active. Professor Kate Jones of University College, London, may have changed this. In Nature Ecology and Evolution, Jones categorized the activity patterns of 2,415 species with representatives from 90 percent of the surviving mammalian families as nocturnal, diurnal, cathemeral (active in both day and night), crepuscular (active during twilight) and ultradian (active in cycles of a few hours). She then mapped the relationships between these species using the two most popular theories of mammals' evolutionary history.
Tracing back the mammal family tree, Jones found either a 74 percent or a 59 percent probability that the last common ancestor of all surviving mammals was nocturnal, depending on which evolutionary theory you choose. Abandoning nocturnality prior to the great extinction event might seem improbable until you remember dinosaurs were in decline for 15 million years before the asteroid finished them off (birds aside, of course).
“It’s very difficult to relate behaviour changes in mammals that lived so long ago to ecological conditions at the time, so we can’t say that the dinosaurs dying out caused mammals to start being active in the daytime. However, we see a clear correlation in our findings,” Jones said in a statement.
Mammals didn't suddenly jump from being nocturnal to diurnal, instead going through a long cathermal phase, where some stayed. One possible mammal family tree has this beginning shortly after the extinction of the non-avian dinosaurs, but the other places it at least 9 million years earlier. Either way, it took about 10 million years until mammals actually preferred the light.
As mammals diversified to fill the newly opened evolutionary niches, primates were fortunate enough to experience mutations that enabled eyesight well suited to a daytime lifestyle. Most other mammals had to make the best of what they had. Of course, some humans, particularly during their teenage years, prefer to revert to the daily cycle resembling their ancient ancestors.