If mammals evolved to be nocturnal, then how did we get so staunchly diurnal in such short time?
The Nocturnal bottleneck for mammals as it's called was assumed 'til recently to have only ended at the Cretaceous–Paleogene extinction event 66 million years ago.

At the basis of the nocturnal bottleneck hypothesis lies the idea that
Mesozoic ectothermic reptiles (including dinosaurs) would be
restricted to daytime activity at times when the sun can help to heat
up their body to operating temperatures.......

The arguments against:

include:


(i) presence of insulating proto-feathers,

(ii) fossils of breeding dinosaurs in cold regions

(iii) raised body posture

(iv) fibrolamellar bone structures

(v) presence of nasal turbulate bone structures

(vi) stable growth rate (isotope deposits in bones and teeth)

(vii) possible ‘mass homeothermia’ or ‘inert homeothermia’ in large dinosaurs

(viii) the occurrence of small dinosaurs in cold regions

(ix) the existence of potential external thermoregulatory structures in some dinosaur species (e.g. dorsal boney plates in Stegosauria).


Recent molecular analyses have added to the doubt of the original theory:

saurischians are now generally believed to have had partial
endothermia, allowing them to incubate their eggs and inhabit colder
regions......
Independently, parallel evolution in Synapsida led to partial
endothermia in therapsid reptiles (250 Ma, Late Permian) and full
endothermia in mammals


Nespolo RF, Bacigalupe LD, Figueroa CC, Koteja P, Opazo JC. 2011. Using new tools to solve an old problem: the evolution of endothermy in vertebrates. Trends Ecol. Evol. 26, 414–423
The implication being that the pure nocturnal adaptation in mammals would not be a completley effective strategy for predator evasion.

In a large comparative study [Roll], divided 700 species into classes of
dominant temporal activity niche: nocturnal, diurnal or both (mostly
crepuscular). They used an existing phylogenetic construction to
reconstruct the evolution of diurnality in rodents, which are thought
to have diversified after the K/T boundary. The reconstruction of
temporal niche usage within rodents led to the conclusion that rodents
shared a nocturnal ancestor that existed before the K/T boundary.
Subsequently, diurnality evolved through secondary evolution at least
seven times independently in Rodentia.
Using the molecular phylogenetic construction of [Huchon et al],
we constructed the temporal niche phylogeny within the full therian
subclass using the nocturnal, diurnal and
crepuscular/arrhythmic classification of [Roll et al.]. The most
parsimonious interpretation leads to a minimum of 16 changes of
dominant temporal niche.

Bolding mine.

Most subdivisions of Theria are indeed nocturnal, but many changes and reversions occurred, and different interpretations may be
possible, especially when higher-quality data on activity patterns in
more species become available.

Conclusion.
It apears that mamals may have been chased by the saurischians throughout the day, night and twilight hours and that many adaptations and reversions may have occured over a period (possibly) much longer than the 66 million years previously thought. Research is ongoing.
Bolded references:
Roll U, Dayan T, Kronfeld-Schor N. 2006. On the role of phylogeny in determining activity patterns of rodents. Evol. Ecol. 20, 479–490
Huchon D, Madsen O, Sibbald MJ, Ament K, Stanhope MJ, Catzeflis F, de Jong WW, Douzery EJ. 2002. Rodent phylogeny and a timescale for the evolution of Glires: evidence from an extensive taxon sampling using three nuclear genes. Mol. Biol. Evol. 19, 1053–1065