A recent study shows that mammals had transformed to diurnal activity after the extinction of the dinosaurs. Before that they were active at night to avoid dinosaurs
Source: https://www.theguardian.com/science/2017/nov/06/mammals-switched-to-daytime-activity-after-dinosaurs-died-out-says-study