Variation in daily activity patterns facilitates temporal partitioning of habitat and resources among species. Knowledge of temporal niche partitioning in paleobiological systems has been limited by the difficulty of obtaining reliable information about activity patterns from fossils. On the basis of an analysis of scleral ring and orbit morphology in 33 archosaurs, including dinosaurs and pterosaurs, we show that the eyes of Mesozoic archosaurs were adapted to all major types of diel activity (that is, nocturnal, diurnal, and cathemeral) and provide concrete evidence of temporal niche partitioning in the Mesozoic. Similar to extant amniotes, flyers were predominantly diurnal; terrestrial predators, at least partially, nocturnal; and large herbivores, cathemeral. These similarities suggest that ecology drives the evolution of diel activity patterns.